add_theme_support( 'html5' ) now defaults to comment-list, comment-form, and search-form.

This was the implicit case in 3.6.0, modified in [25193].

see #24932.


git-svn-id: https://develop.svn.wordpress.org/trunk@25235 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-09-04 17:43:29 +00:00
parent 1e0d32406d
commit db5f9800d4
2 changed files with 26 additions and 9 deletions

View File

@@ -85,9 +85,12 @@ class Tests_Theme_Support extends WP_UnitTestCase {
remove_theme_support( 'html5' );
$this->assertFalse( current_theme_supports( 'html5' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertFalse( add_theme_support( 'html5' ) );
$this->assertFalse( current_theme_supports( 'html5' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertNotSame( false, add_theme_support( 'html5' ) );
$this->assertTrue( current_theme_supports( 'html5' ) );
$this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) );
$this->assertTrue( current_theme_supports( 'html5', 'search-form' ) );
$this->assertFalse( current_theme_supports( 'html5', 'something-else' ) );
}
/**
@@ -106,19 +109,29 @@ class Tests_Theme_Support extends WP_UnitTestCase {
$this->assertTrue( current_theme_supports( 'html5' ) );
// It appends, rather than replaces.
$this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) );
$this->assertNotSame( false, add_theme_support( 'html5', array( 'comments-list' ) ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) );
$this->assertNotSame( false, add_theme_support( 'html5', array( 'comment-list' ) ) );
$this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertTrue( current_theme_supports( 'html5', 'comments-list' ) );
$this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) );
$this->assertFalse( current_theme_supports( 'html5', 'search-form' ) );
// Removal is all or nothing.
$this->assertTrue( remove_theme_support( 'html5' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comments-form' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertFalse( current_theme_supports( 'html5', 'search-form' ) );
}
/**
* @ticket 24932
*/
function test_supports_html5_invalid() {
remove_theme_support( 'html5' );
$this->assertFalse( add_theme_support( 'html5', 'comment-form' ) );
$this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
$this->assertFalse( current_theme_supports( 'html5' ) );
}
function supports_foobar( $yesno, $args, $feature ) {
if ( $args[0] == $feature[0] )
return true;