Better way

This commit is contained in:
Lance Pioch 2024-03-23 11:27:26 -04:00
parent e3947e4b50
commit f795b38db5

View File

@ -110,13 +110,9 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase
$rawTokens = $response->json('attributes.tokens'); $rawTokens = $response->json('attributes.tokens');
$rawToken = reset($rawTokens); $rawToken = reset($rawTokens);
$hashed = reset($tokens);
$working = false; throw_unless(password_verify($rawToken, $hashed), new ExpectationFailedException(sprintf('Failed asserting that token [%s] exists as a hashed value in recovery_tokens table.', $rawToken)));
foreach ($tokens as $hashed) {
$working = $working || password_verify($rawToken, $hashed);
}
throw_unless($working, new ExpectationFailedException(sprintf('Failed asserting that token [%s] exists as a hashed value in recovery_tokens table.', $rawToken)));
} }
/** /**