Suppress the `doing_it_wrong` notice from firing in `tests/phpunit/`tests/dependencies/jquery.php` when running in debug mode.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25375 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
591a96743e
commit
148d8e1e29
|
@ -50,14 +50,29 @@ class Tests_Dependencies_jQuery extends WP_UnitTestCase {
|
|||
'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',
|
||||
'jquery-ui-tooltip', 'jquery-ui-widget', 'backbone', 'underscore',
|
||||
);
|
||||
|
||||
add_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
|
||||
|
||||
foreach ( $libraries as $library ) {
|
||||
// Try to deregister the script, which should fail.
|
||||
wp_deregister_script( $library );
|
||||
$this->assertTrue( wp_script_is( $library, 'registered' ) );
|
||||
}
|
||||
|
||||
remove_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
|
||||
|
||||
set_current_screen( 'front' );
|
||||
}
|
||||
|
||||
function doing_it_wrong_run() {
|
||||
add_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
|
||||
}
|
||||
|
||||
function doing_it_wrong_trigger_error() {
|
||||
remove_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 24994
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue