diff --git a/.wp-env.json b/.wp-env.json index 0dafc210..8e06478a 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -4,6 +4,7 @@ "env": { "tests": { "config": { + "WP_DEBUG": true, "WP_TESTS_EMAIL": "admin@example.org", "WP_TESTS_DOMAIN": "example.org", "WP_SITEURL": "https://example.org", diff --git a/class-two-factor-core.php b/class-two-factor-core.php index c4858ce1..c5864340 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -209,7 +209,7 @@ public static function get_providers() { * @return array */ public static function enable_dummy_method_for_debug( $methods ) { - if ( ! self::is_wp_debug() && ! self::is_tests() ) { + if ( ! self::is_wp_debug() ) { unset( $methods['Two_Factor_Dummy'] ); } @@ -225,15 +225,6 @@ protected static function is_wp_debug() { return ( defined( 'WP_DEBUG' ) && WP_DEBUG ); } - /** - * Check if we're running within Unit Tests. - * - * @return boolean - */ - protected static function is_tests() { - return defined( 'DIR_TESTDATA' ) && function_exists( 'tests_add_filter' ); - } - /** * Get the user settings page URL. *