diff --git a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php index 8eb4fce78b251..b6c85c58c2e05 100644 --- a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php @@ -368,6 +368,29 @@ public function test_get_all_registered_includes_hooked_blocks() { $this->assertSame( $expected, $registered ); } + /** + * Should insert a theme attribute into Template Part blocks in registered patterns. + * + * @ticket XXXXX + * + * @covers WP_Block_Patterns_Registry::register + * @covers WP_Block_Patterns_Registry::get_registered + */ + public function test_get_registered_includes_theme_attribute() { + $test_pattern = array( + 'title' => 'Test Pattern', + 'content' => '', + ); + $this->registry->register( 'test/pattern', $test_pattern ); + + $expected = sprintf( + '', + get_stylesheet() + ); + $pattern = $this->registry->get_registered( 'test/pattern' ); + $this->assertSame( $expected, $pattern['content'] ); + } + /** * Should insert hooked blocks into registered patterns. *