| | 180 | |
| | 181 | /** |
| | 182 | * @ticket 38168 |
| | 183 | */ |
| | 184 | public function test_custom_background_class_is_added_when_theme_supports_it() { |
| | 185 | add_theme_support( 'custom-background', array( 'default-color', '#ffffff' ) ); |
| | 186 | set_theme_mod( 'background_color', '#000000' ); |
| | 187 | |
| | 188 | $actual = get_body_class(); |
| | 189 | $current_theme_supports_custom_background = current_theme_supports( 'custom-background' ); |
| | 190 | |
| | 191 | remove_theme_mod( 'background_color' ); |
| | 192 | remove_theme_support( 'custom-background' ); |
| | 193 | |
| | 194 | $this->assertTrue( $current_theme_supports_custom_background ); |
| | 195 | $this->assertContains( 'custom-background', $actual ); |
| | 196 | } |
| | 197 | |
| | 198 | /** |
| | 199 | * @ticket 38168 |
| | 200 | */ |
| | 201 | public function test_custom_background_class_is_not_added_when_theme_support_is_missing() { |
| | 202 | set_theme_mod( 'background_color', '#000000' ); |
| | 203 | |
| | 204 | $actual = get_body_class(); |
| | 205 | $current_theme_supports_custom_background = current_theme_supports( 'custom-background' ); |
| | 206 | |
| | 207 | remove_theme_mod( 'background_color' ); |
| | 208 | |
| | 209 | $this->assertFalse( $current_theme_supports_custom_background ); |
| | 210 | $this->assertNotContains( 'custom-background', $actual ); |
| | 211 | } |