Skip to content

Commit

Permalink
Add ticket PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Nov 28, 2023
1 parent 450c05f commit bef2301
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/phpunit/tests/blocks/getHookedBlockMarkup
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
class Tests_Blocks_GetHookedBlockMarkup extends WP_UnitTestCase
{
/**
* @ticket 59646
*
* @covers ::get_hooked_block_markup
*/
public function test_get_hooked_block_markup() {
Expand All @@ -24,4 +26,24 @@ class Tests_Blocks_GetHookedBlockMarkup extends WP_UnitTestCase
$this->assertSame( array( 'tests/hooked-block' ), $anchor_block['attrs']['metadata']['ignoredHookedBlocks'] );
$this->assertSame( '<!-- wp:tests/hooked-block /-->', $actual );
}

/**
* @ticket 59646
*
* @covers ::get_hooked_block_markup
*/
public function test_get_hooked_block_markup_if_block_is_already_hooked() {
$anchor_block = array(
'blockName' => 'tests/anchor-block',
'attrs' => array(
'metadata' => array(
'ignoredHookedBlocks' => array( 'tests/hooked-block' ),
),
)
);

$actual = get_hooked_block_markup( $anchor_block, 'tests/hooked-block' );
$this->assertSame( array( 'tests/hooked-block' ), $anchor_block['attrs']['metadata']['ignoredHookedBlocks'] );
$this->assertSame( '', $actual );
}
}

0 comments on commit bef2301

Please sign in to comment.