- Timestamp:
- 03/11/2025 06:13:47 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r59822 r59965 164 164 * @ticket 45016 165 165 * @ticket 61021 166 * @ticket 62574. 166 167 */ 167 168 public function test_get_items() { … … 176 177 'author', 177 178 'author_uri', 179 'default_template_part_areas', 180 'default_template_types', 178 181 'description', 179 182 'is_block_theme', … … 355 358 * @ticket 45016 356 359 * @ticket 61021 360 * @ticket 62574 357 361 */ 358 362 public function test_get_item_schema() { … … 360 364 $data = $response->get_data(); 361 365 $properties = $data['schema']['properties']; 362 $this->assertCount( 18, $properties );366 $this->assertCount( 20, $properties ); 363 367 364 368 $this->assertArrayHasKey( 'author', $properties ); … … 373 377 $this->assertArrayHasKey( 'raw', $properties['description']['properties'] ); 374 378 $this->assertArrayHasKey( 'rendered', $properties['description']['properties'] ); 379 380 $this->assertArrayHasKey( 'default_template_part_areas', $properties ); 381 $this->assertArrayHasKey( 'default_template_types', $properties ); 375 382 376 383 $this->assertArrayHasKey( 'is_block_theme', $properties ); … … 474 481 475 482 /** 483 * @ticket 62574 484 */ 485 public function test_theme_default_template_part_areas() { 486 $response = self::perform_active_theme_request(); 487 $result = $response->get_data(); 488 $this->assertArrayHasKey( 'default_template_part_areas', $result[0] ); 489 $this->assertSame( get_allowed_block_template_part_areas(), $result[0]['default_template_part_areas'] ); 490 } 491 492 /** 493 * @ticket 62574 494 */ 495 public function test_theme_default_template_types() { 496 $response = self::perform_active_theme_request(); 497 $result = $response->get_data(); 498 $expected = array(); 499 foreach ( get_default_block_template_types() as $slug => $template_type ) { 500 $template_type['slug'] = (string) $slug; 501 $expected[] = $template_type; 502 } 503 504 $this->assertArrayHasKey( 'default_template_types', $result[0] ); 505 $this->assertSame( $expected, $result[0]['default_template_types'] ); 506 } 507 508 /** 476 509 * @ticket 49906 477 510 */
Note: See TracChangeset
for help on using the changeset viewer.