| 81 | /** |
| 82 | * @ticket 24932 |
| 83 | */ |
| 84 | function test_supports_html5() { |
| 85 | remove_theme_support( 'html5' ); |
| 86 | $this->assertFalse( current_theme_supports( 'html5' ) ); |
| 87 | $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); |
| 88 | $this->assertFalse( add_theme_support( 'html5' ) ); |
| 89 | $this->assertFalse( current_theme_supports( 'html5' ) ); |
| 90 | $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * @ticket 24932 |
| 95 | */ |
| 96 | function test_supports_html5_subset() { |
| 97 | remove_theme_support( 'html5' ); |
| 98 | $this->assertFalse( current_theme_supports( 'html5' ) ); |
| 99 | $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); |
| 100 | $this->assertFalse( add_theme_support( 'html5', 'comment-form' ) ); |
| 101 | $this->assertNotSame( false, add_theme_support( 'html5', array( 'comment-form' ) ) ); |
| 102 | $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); |
| 103 | |
| 104 | // This will return true, which might help a plugin author decide what markup to serve, |
| 105 | // but core should never check for it. |
| 106 | $this->assertTrue( current_theme_supports( 'html5' ) ); |
| 107 | |
| 108 | // It appends, rather than replaces. |
| 109 | $this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) ); |
| 110 | $this->assertNotSame( false, add_theme_support( 'html5', array( 'comments-list' ) ) ); |
| 111 | $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); |
| 112 | $this->assertTrue( current_theme_supports( 'html5', 'comments-list' ) ); |
| 113 | $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); |
| 114 | |
| 115 | // Removal is all or nothing. |
| 116 | $this->assertTrue( remove_theme_support( 'html5' ) ); |
| 117 | $this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) ); |
| 118 | $this->assertFalse( current_theme_supports( 'html5', 'comments-form' ) ); |
| 119 | $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); |
| 120 | } |
| 121 | |