Skip to content

Commit 8f53c8b

Browse files
committed
Use Post Content block as anchor in existing tests
1 parent 6e12f44 commit 8f53c8b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/phpunit/tests/blocks/applyBlockHooksToContent.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ class Tests_Blocks_ApplyBlockHooksToContent extends WP_UnitTestCase {
1717
* Set up.
1818
*
1919
* @ticket 61902.
20+
* @ticket 63287.
2021
*/
2122
public static function wpSetUpBeforeClass() {
2223
register_block_type(
2324
'tests/hooked-block',
2425
array(
2526
'block_hooks' => array(
26-
'tests/anchor-block' => 'after',
27+
'core/post-content' => 'after',
2728
),
2829
)
2930
);
@@ -79,23 +80,25 @@ public function test_apply_block_hooks_to_content_sets_theme_attribute_on_templa
7980

8081
/**
8182
* @ticket 61902
83+
* @ticket 63287
8284
*/
8385
public function test_apply_block_hooks_to_content_inserts_hooked_block() {
8486
$context = new WP_Block_Template();
85-
$context->content = '<!-- wp:tests/anchor-block /-->';
87+
$context->content = '<!-- wp:post-content /-->';
8688

8789
$actual = apply_block_hooks_to_content( $context->content, $context, 'insert_hooked_blocks' );
8890
$this->assertSame(
89-
'<!-- wp:tests/anchor-block /--><!-- wp:tests/hooked-block /-->',
91+
'<!-- wp:post-content /--><!-- wp:tests/hooked-block /-->',
9092
$actual
9193
);
9294
}
9395

9496
/**
9597
* @ticket 61074
98+
* @ticket 63287
9699
*/
97100
public function test_apply_block_hooks_to_content_with_context_set_to_null() {
98-
$content = '<!-- wp:tests/anchor-block /-->';
101+
$content = '<!-- wp:post-content /-->';
99102

100103
/*
101104
* apply_block_hooks_to_content() will fall back to the global $post object (via get_post())
@@ -106,7 +109,7 @@ public function test_apply_block_hooks_to_content_with_context_set_to_null() {
106109

107110
$actual = apply_block_hooks_to_content( $content, null, 'insert_hooked_blocks' );
108111
$this->assertSame(
109-
'<!-- wp:tests/anchor-block /--><!-- wp:tests/hooked-block /-->',
112+
'<!-- wp:post-content /--><!-- wp:tests/hooked-block /-->',
110113
$actual
111114
);
112115
}

0 commit comments

Comments
 (0)