diff --git a/tests/class-two-factor-core.php b/tests/class-two-factor-core.php index a8ad1816..c7ebe8e5 100644 --- a/tests/class-two-factor-core.php +++ b/tests/class-two-factor-core.php @@ -1585,6 +1585,21 @@ function( $providers, $user ) { remove_all_filters( 'two_factor_providers_for_user' ); } + public function test_can_disable_default_providers() { + $this->assertContains( 'Two_Factor_Email', array_keys( Two_Factor_Core::get_providers() ), 'Email provider is enabled by default' ); + + add_filter( + 'two_factor_providers', + function ( $providers ) { + return array_diff_key( $providers, array( 'Two_Factor_Email' => null ) ); + } + ); + + $this->assertNotContains( 'Two_Factor_Email', array_keys( Two_Factor_Core::get_providers() ), 'Default provider can be disabled via a filter' ); + + remove_all_filters( 'two_factor_providers' ); + } + /** * Plugin uninstall removes all user meta. * @@ -1611,21 +1626,6 @@ public function test_uninstall_removes_user_meta() { ); } - public function test_can_disable_default_providers() { - $this->assertContains( 'Two_Factor_Email', array_keys( Two_Factor_Core::get_providers() ), 'Email provider is enabled by default' ); - - add_filter( - 'two_factor_providers', - function ( $providers ) { - return array_diff_key( $providers, array( 'Two_Factor_Email' => null ) ); - } - ); - - $this->assertNotContains( 'Two_Factor_Email', array_keys( Two_Factor_Core::get_providers() ), 'Default provider can be disabled via a filter' ); - - remove_all_filters( 'two_factor_providers' ); - } - /** * Plugin uninstall removes all user meta even for disabled providers. *