- Timestamp:
- 10/22/2018 07:57:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/tests/phpunit/tests/rest-api/rest-themes-controller.php
r43735 r43790 190 190 $this->assertArrayHasKey( 'theme_supports', $properties ); 191 191 192 $this->assertEquals( 2, count( $properties['theme_supports']['properties'] ) );192 $this->assertEquals( 3, count( $properties['theme_supports']['properties'] ) ); 193 193 $this->assertArrayHasKey( 'formats', $properties['theme_supports']['properties'] ); 194 194 $this->assertArrayHasKey( 'post-thumbnails', $properties['theme_supports']['properties'] ); 195 $this->assertArrayHasKey( 'responsive-embeds', $properties['theme_supports']['properties'] ); 195 196 } 196 197 … … 221 222 $this->assertTrue( isset( $result[0]['theme_supports']['formats'] ) ); 222 223 $this->assertSame( array( 'standard', 'aside', 'video' ), $result[0]['theme_supports']['formats'] ); 224 } 225 226 /** 227 * Test when a theme does not support responsive embeds. 228 * 229 * @ticket 45016 230 */ 231 public function test_theme_supports_responsive_embeds_false() { 232 remove_theme_support( 'responsive-embeds' ); 233 $response = self::perform_active_theme_request(); 234 235 $result = $response->get_data(); 236 $this->assertTrue( isset( $result[0]['theme_supports'] ) ); 237 $this->assertTrue( isset( $result[0]['theme_supports']['responsive-embeds'] ) ); 238 $this->assertFalse( $result[0]['theme_supports']['responsive-embeds'] ); 239 } 240 241 /** 242 * Test when a theme supports responsive embeds. 243 * 244 * @ticket 45016 245 */ 246 public function test_theme_supports_responsive_embeds_true() { 247 remove_theme_support( 'responsive-embeds' ); 248 add_theme_support( 'responsive-embeds' ); 249 $response = self::perform_active_theme_request(); 250 $result = $response->get_data(); 251 $this->assertTrue( isset( $result[0]['theme_supports'] ) ); 252 $this->assertTrue( $result[0]['theme_supports']['responsive-embeds'] ); 223 253 } 224 254
Note: See TracChangeset
for help on using the changeset viewer.