File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1558,13 +1558,16 @@ public function test_all_sessions_destroyed_when_enabling_2fa_by_admin() {
1558
1558
1559
1559
public function test_can_filter_registered_providers_for_user () {
1560
1560
$ user = self ::factory ()->user ->create_and_get ();
1561
+ $ providers = Two_Factor_Core::get_providers ();
1561
1562
1562
1563
$ this ->assertEquals (
1563
- Two_Factor_Core:: get_providers () ,
1564
+ $ providers ,
1564
1565
Two_Factor_Core::get_supported_providers_for_user ( $ user ),
1565
1566
'All providers are available by default '
1566
1567
);
1567
1568
1569
+ $ this ->assertTrue ( $ providers ['Two_Factor_Email ' ]::is_supported_for_user ( $ user ), 'Email provider is supported by default ' );
1570
+
1568
1571
add_filter (
1569
1572
'two_factor_providers_for_user ' ,
1570
1573
function ( $ providers , $ user ) {
@@ -1582,6 +1585,8 @@ function( $providers, $user ) {
1582
1585
'Email provider can be disabled for a user '
1583
1586
);
1584
1587
1588
+ $ this ->assertFalse ( $ providers ['Two_Factor_Email ' ]::is_supported_for_user ( $ user ), 'Email provider is disabled if not supported ' );
1589
+
1585
1590
remove_all_filters ( 'two_factor_providers_for_user ' );
1586
1591
}
1587
1592
You can’t perform that action at this time.
0 commit comments