Make WordPress Core

Changeset 25375


Ignore:
Timestamp:
09/12/2013 04:08:03 AM (11 years ago)
Author:
wonderboymusic
Message:

Suppress the doing_it_wrong notice from firing in tests/phpunit/tests/dependencies/jquery.php` when running in debug mode.

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/jquery.php

    r25072 r25375  
    5151            'jquery-ui-tooltip', 'jquery-ui-widget', 'backbone', 'underscore',
    5252        );
     53
     54        add_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
     55
    5356        foreach ( $libraries as $library ) {
    5457            // Try to deregister the script, which should fail.
     
    5659            $this->assertTrue( wp_script_is( $library, 'registered' ) );
    5760        }
     61
     62        remove_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
     63
    5864        set_current_screen( 'front' );
     65    }
     66
     67    function doing_it_wrong_run() {
     68        add_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
     69    }
     70
     71    function doing_it_wrong_trigger_error() {
     72        remove_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
     73        return false;
    5974    }
    6075
Note: See TracChangeset for help on using the changeset viewer.