Skip to content

Commit

Permalink
Check if on tests and silence notice if so
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidasmi committed Jan 14, 2025
1 parent 870b6c8 commit d5a08d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/options/class-wpseo-option.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ abstract class WPSEO_Option {
*/
protected function __construct() {

if ( defined( WERE_ARE_DOING_TESTS ) && WERE_ARE_DOING_TESTS ) {
add_action( 'doing_it_wrong_trigger_error', function ( $function_name, $message, $error_level ) {

Check warning on line 149 in inc/options/class-wpseo-option.php

View workflow job for this annotation

GitHub Actions / Check code style

The method parameter $message is never used

Check warning on line 149 in inc/options/class-wpseo-option.php

View workflow job for this annotation

GitHub Actions / Check code style

The method parameter $error_level is never used

Check warning on line 149 in inc/options/class-wpseo-option.php

View workflow job for this annotation

GitHub Actions / Check code style

Unused function parameter $message.

Check warning on line 149 in inc/options/class-wpseo-option.php

View workflow job for this annotation

GitHub Actions / Check code style

Unused function parameter $error_level.
if ( '_load_textdomain_just_in_time ' == $function_name ) {

Check warning on line 150 in inc/options/class-wpseo-option.php

View workflow job for this annotation

GitHub Actions / Check code style

Loose comparisons are not allowed. Expected: "==="; Found: "=="
return false;
}
}, 10, 3 );
}

/* Add filters which get applied to the get_options() results. */
$this->add_default_filters(); // Return defaults if option not set.
$this->add_option_filters(); // Merge with defaults if option *is* set.
Expand Down

0 comments on commit d5a08d2

Please sign in to comment.