From 328aa110e28bdbf6ba93eab1561c74f87feeec58 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Tue, 1 Jul 2025 21:52:30 -0500 Subject: [PATCH] Create tests for app/actions/fortify/UpdateUserPassword --- .../Fortify/UpdateUserPasswordTest.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/Feature/app/Actions/Fortify/UpdateUserPasswordTest.php diff --git a/tests/Feature/app/Actions/Fortify/UpdateUserPasswordTest.php b/tests/Feature/app/Actions/Fortify/UpdateUserPasswordTest.php new file mode 100644 index 0000000..9e690c3 --- /dev/null +++ b/tests/Feature/app/Actions/Fortify/UpdateUserPasswordTest.php @@ -0,0 +1,23 @@ +user = User::factory()->create(); + $this->changer = app(UpdateUserPassword::class); + + // Log in the user + $this->actingAs($this->user); +}); + +it('updates a users password', function () { + $this->changer->update($this->user, + ['password' => 'password123', 'password_confirmation' => 'password123', 'current_password' => 'password']); + + expect(Hash::check('password123', $this->user->password))->toBeTrue(); +});