Skip to content

Commit 6e80092

Browse files
committed
fix(tests): update missed assertion in resend-while-rate-limited test
Commit 7bbb96e updated three `user_has_token` assertions to `assertTrue` when the token-preservation behaviour was introduced, but missed one that used `get_user_token` instead. Same fix: the token is preserved when a rate-limited resend is blocked, to prevent auto-send on form re-render.
1 parent 7ffeb84 commit 6e80092

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/class-two-factor-core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ public function test_process_provider_blocks_email_resend_while_rate_limited() {
794794

795795
$this->assertWPError( $result );
796796
$this->assertSame( 'two_factor_too_fast', $result->get_error_code() );
797-
$this->assertFalse( $provider->get_user_token( $user->ID ), 'Token is invalidated when rate limited' );
797+
$this->assertTrue( $provider->user_has_token( $user->ID ), 'Token is preserved when resend is blocked, to prevent auto-send on form re-render' );
798798
}
799799

800800
/**

0 commit comments

Comments
 (0)