Skip to content

Commit f801c3a

Browse files
committed
Check for known things instead
1 parent 80d7f98 commit f801c3a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/class-two-factor-core.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -1568,19 +1568,16 @@ public function test_can_filter_registered_providers_for_user() {
15681568
add_filter(
15691569
'two_factor_providers_for_user',
15701570
function( $providers, $user ) {
1571-
$this->assertInstanceOf( WP_User::class, $user );
1571+
$this->assertInstanceOf( WP_User::class, $user, 'A user referenced is passed to the filter' );
15721572

15731573
return array_diff_key( $providers, array( 'Two_Factor_Email' => null ) );
15741574
},
15751575
10,
15761576
2
15771577
);
15781578

1579-
$providers = Two_Factor_Core::get_providers();
1580-
unset( $providers['Two_Factor_Email'] );
1581-
1582-
$this->assertEquals(
1583-
$providers,
1579+
$this->assertNotContains(
1580+
'Two_Factor_Email',
15841581
Two_Factor_Core::get_supported_providers_for_user( $user ),
15851582
'Email provider can be disabled for a user'
15861583
);

0 commit comments

Comments
 (0)