From ef73917eaa4507c49b0d7ebe860412da3d9c2d73 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 29 Nov 2023 13:49:07 +0100 Subject: [PATCH] Add test case --- .../tests/blocks/getHookedBlockMarkup.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/phpunit/tests/blocks/getHookedBlockMarkup.php b/tests/phpunit/tests/blocks/getHookedBlockMarkup.php index 4c1b0014882b2..2406c787b6b8e 100644 --- a/tests/phpunit/tests/blocks/getHookedBlockMarkup.php +++ b/tests/phpunit/tests/blocks/getHookedBlockMarkup.php @@ -46,4 +46,24 @@ public function test_get_hooked_block_markup_if_block_is_already_hooked() { $this->assertSame( array( 'tests/hooked-block' ), $anchor_block['attrs']['metadata']['ignoredHookedBlocks'] ); $this->assertSame( '', $actual ); } + + /** + * @ticket 59646 + * + * @covers ::get_hooked_block_markup + */ + public function test_get_hooked_block_markup_adds_to_ignored_hooked_blocks() { + $anchor_block = array( + 'blockName' => 'tests/anchor-block', + 'attrs' => array( + 'metadata' => array( + 'ignoredHookedBlocks' => array( 'tests/hooked-block' ), + ), + ) + ); + + $actual = get_hooked_block_markup( $anchor_block, 'tests/other-hooked-block' ); + $this->assertSame( array( 'tests/hooked-block', 'tests/other-hooked-block' ), $anchor_block['attrs']['metadata']['ignoredHookedBlocks'] ); + $this->assertSame( '', $actual ); + } }