Skip to content

Commit

Permalink
Run tests with WP_DEBUG enabled, such as not to need to include unit-…
Browse files Browse the repository at this point in the history
…test customisations to plugin.
  • Loading branch information
dd32 committed Aug 22, 2024
1 parent a2dcc9a commit 99504ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"env": {
"tests": {
"config": {
"WP_DEBUG": true,
"WP_TESTS_EMAIL": "[email protected]",
"WP_TESTS_DOMAIN": "example.org",
"WP_SITEURL": "https://example.org",
Expand Down
11 changes: 1 addition & 10 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] );
}

Expand All @@ -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.
*
Expand Down

0 comments on commit 99504ae

Please sign in to comment.