Skip to content

Commit

Permalink
Check for known things instead
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Feb 14, 2025
1 parent 80d7f98 commit f801c3a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1568,19 +1568,16 @@ public function test_can_filter_registered_providers_for_user() {
add_filter(
'two_factor_providers_for_user',
function( $providers, $user ) {
$this->assertInstanceOf( WP_User::class, $user );
$this->assertInstanceOf( WP_User::class, $user, 'A user referenced is passed to the filter' );

return array_diff_key( $providers, array( 'Two_Factor_Email' => null ) );
},
10,
2
);

$providers = Two_Factor_Core::get_providers();
unset( $providers['Two_Factor_Email'] );

$this->assertEquals(
$providers,
$this->assertNotContains(
'Two_Factor_Email',
Two_Factor_Core::get_supported_providers_for_user( $user ),
'Email provider can be disabled for a user'
);
Expand Down

0 comments on commit f801c3a

Please sign in to comment.