- Timestamp:
- 06/25/2020 10:11:09 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r47921 r48171 261 261 262 262 $theme_supports = $properties['theme_supports']['properties']; 263 $this->assertEquals( 20, count( $theme_supports ) );264 263 $this->assertArrayHasKey( 'align-wide', $theme_supports ); 265 264 $this->assertArrayHasKey( 'automatic-feed-links', $theme_supports ); … … 282 281 $this->assertArrayHasKey( 'title-tag', $theme_supports ); 283 282 $this->assertArrayHasKey( 'wp-block-styles', $theme_supports ); 283 $this->assertCount( 20, $theme_supports ); 284 284 } 285 285 … … 999 999 1000 1000 /** 1001 * @ticket 49406 1002 */ 1003 public function test_variadic_theme_support() { 1004 register_theme_feature( 1005 'test-feature', 1006 array( 1007 'type' => 'array', 1008 'variadic' => true, 1009 'show_in_rest' => array( 1010 'schema' => array( 1011 'items' => array( 1012 'type' => 'string', 1013 ), 1014 ), 1015 ), 1016 ) 1017 ); 1018 add_theme_support( 'test-feature', 'a', 'b', 'c' ); 1019 1020 $response = self::perform_active_theme_request(); 1021 $result = $response->get_data(); 1022 $this->assertTrue( isset( $result[0]['theme_supports'] ) ); 1023 $this->assertEquals( array( 'a', 'b', 'c' ), $result[0]['theme_supports']['test-feature'] ); 1024 } 1025 1026 /** 1001 1027 * It should be possible to register custom fields to the endpoint. 1002 1028 *
Note: See TracChangeset
for help on using the changeset viewer.