From b1ad38a08e580aa39a420ea4221b35abf76f7cc6 Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Fri, 12 Apr 2024 16:05:31 -0400 Subject: [PATCH] Add test --- tests/Feature/DatabaseUserProviderTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Feature/DatabaseUserProviderTest.php b/tests/Feature/DatabaseUserProviderTest.php index beba034f..38d20067 100644 --- a/tests/Feature/DatabaseUserProviderTest.php +++ b/tests/Feature/DatabaseUserProviderTest.php @@ -159,4 +159,17 @@ public function test_failing_loudly_throws_exception_when_resolving_users() $provider->retrieveByCredentials([]); } + + public function test_rehash_password_if_required_does_nothing_when_password_column_disabled() + { + $synchronizer = new UserSynchronizer(TestUserModelStub::class, [ + 'password_column' => false, + ]); + + $provider = $this->createDatabaseUserProvider(synchronizer: $synchronizer); + + $provider->rehashPasswordIfRequired($model = new TestUserModelStub, ['password' => 'secret']); + + $this->assertNull($model->password); + } }