test(auth): cover password reset expiration

This commit is contained in:
2026-08-25 14:10:38 -03:00
parent 733064c0dc
commit 2596b5df18
4 changed files with 53 additions and 0 deletions

View File

@@ -18,7 +18,9 @@ class ResetPasswordAttemptTest extends TestCase
'id',
'user_id',
'codigo',
'reason',
'status',
'expires_at',
], Schema::getColumnListing('reset_password_attempts'));
}
@@ -28,12 +30,14 @@ class ResetPasswordAttemptTest extends TestCase
$attempt = $user->resetPasswordAttempts()->create([
'codigo' => '123456',
'expires_at' => now()->addHour(),
]);
$this->assertSame(ResetPasswordAttempt::STATUS_PENDING, $attempt->status);
$this->assertTrue($attempt->user->is($user));
$this->assertTrue($user->resetPasswordAttempts->contains($attempt));
$this->assertFalse($attempt->usesTimestamps());
$this->assertTrue($attempt->expires_at->isFuture());
$this->assertArrayNotHasKey('codigo', $attempt->toArray());
}