From 148d8e1e2918134f30006585bd39b2b78056e315 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 12 Sep 2013 04:08:03 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/dependencies/jquery.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/phpunit/tests/dependencies/jquery.php b/tests/phpunit/tests/dependencies/jquery.php index 6d738c5a52..aaacab67dc 100644 --- a/tests/phpunit/tests/dependencies/jquery.php +++ b/tests/phpunit/tests/dependencies/jquery.php @@ -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 */