Changeset 59073 for trunk/tests/phpunit/tests/block-template.php
- Timestamp:
- 09/20/2024 02:05:50 AM (19 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/block-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-template.php
r59061 r59073 435 435 436 436 /** 437 * Tests that get_block_templates() returns plugin-registered templates. 438 * 439 * @ticket 61804 440 * 441 * @covers ::get_block_templates 442 */ 443 public function test_get_block_templates_from_registry() { 444 $template_name = 'test-plugin//test-template'; 445 446 wp_register_block_template( $template_name ); 447 448 $templates = get_block_templates(); 449 450 $this->assertArrayHasKey( $template_name, $templates ); 451 452 wp_unregister_block_template( $template_name ); 453 } 454 455 /** 456 * Tests that get_block_template() returns plugin-registered templates. 457 * 458 * @ticket 61804 459 * 460 * @covers ::get_block_template 461 */ 462 public function test_get_block_template_from_registry() { 463 $template_name = 'test-plugin//test-template'; 464 $args = array( 465 'title' => 'Test Template', 466 ); 467 468 wp_register_block_template( $template_name, $args ); 469 470 $template = get_block_template( 'block-theme//test-template' ); 471 472 $this->assertSame( 'Test Template', $template->title ); 473 474 wp_unregister_block_template( $template_name ); 475 } 476 477 /** 437 478 * Registers a test block to log `in_the_loop()` results. 438 479 *
Note: See TracChangeset
for help on using the changeset viewer.