Make WordPress Core

Changeset 25387


Ignore:
Timestamp:
09/12/2013 05:39:45 AM (11 years ago)
Author:
wonderboymusic
Message:

Suppress the _doing_it_wrong notices when calling add_theme_support( 'html5' ) in tests/theme/support.php

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/support.php

    r25235 r25387  
    55 */
    66class Tests_Theme_Support extends WP_UnitTestCase {
     7
     8    function setUp() {
     9        parent::setUp();
     10        add_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
     11    }
     12
     13    function tearDown() {
     14        parent::tearDown();
     15        remove_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
     16    }
     17
     18    function doing_it_wrong_run( $function ) {
     19        if ( in_array( $function, array( "add_theme_support( 'html5' )" ) ) )
     20            add_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
     21    }
     22
     23    function doing_it_wrong_trigger_error() {
     24        remove_filter( 'doing_it_wrong_trigger_error', array( $this, 'doing_it_wrong_trigger_error' ) );
     25        return false;
     26    }
    727
    828    function test_the_basics() {
Note: See TracChangeset for help on using the changeset viewer.