From 5422ba14c81fc6738627090f228843f59858aa37 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 14 Feb 2025 17:09:05 +0200 Subject: [PATCH] Keep together similar tests --- tests/class-two-factor-core.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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. *