Skip to content

Commit

Permalink
Add test coverage for injecting theme attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Sep 27, 2024
1 parent a89754b commit 4af6a2b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/phpunit/tests/blocks/applyBlockHooksToContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ public static function wpTearDownAfterClass() {
$registry->unregister( 'tests/dynamically-hooked-block-with-multiple-false' );
}

/**
* @ticket 61902
*/
public function test_apply_block_hooks_to_content_sets_theme_attribute_on_template_part_block() {
$context = new WP_Block_Template();
$context->content = '<!-- wp:template-part /-->';

$actual = apply_block_hooks_to_content( $context->content, $context, 'insert_hooked_blocks' );
$this->assertSame(
sprintf( '<!-- wp:template-part {"theme":"%s"} /-->', get_stylesheet() ),
$actual
);
}

/**
* @ticket 61902
*/
Expand Down

0 comments on commit 4af6a2b

Please sign in to comment.