Files
speedBB/tests/Unit/ResetUserPasswordTest.php
tracer 88e4a70f88
Some checks failed
CI/CD Pipeline / test (push) Successful in 3s
CI/CD Pipeline / deploy (push) Failing after 15s
Add comprehensive test coverage and update notes
2026-02-08 19:04:12 +01:00

21 lines
527 B
PHP

<?php
use App\Actions\Fortify\ResetUserPassword;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
it('resets user password after validation', function (): void {
$user = User::factory()->create([
'password' => Hash::make('OldPass123!'),
]);
$action = new ResetUserPassword();
$action->reset($user, [
'password' => 'NewPass123!',
'password_confirmation' => 'NewPass123!',
]);
$user->refresh();
expect(Hash::check('NewPass123!', $user->password))->toBeTrue();
});