Suppress the _doing_it_wrong
notices when calling add_theme_support( 'html5' )
in tests/theme/support.php
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c5c88eb85b
commit
ee35baae6b
@ -5,6 +5,26 @@
|
||||
*/
|
||||
class Tests_Theme_Support extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
add_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
remove_action( 'doing_it_wrong_run', array( $this, 'doing_it_wrong_run' ) );
|
||||
}
|
||||
|
||||
function doing_it_wrong_run( $function ) {
|
||||
if ( in_array( $function, array( "add_theme_support( 'html5' )" ) ) )
|
||||
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;
|
||||
}
|
||||
|
||||
function test_the_basics() {
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
$this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
|
||||
|
Loading…
Reference in New Issue
Block a user