From 950e76270f5ff9495e3db176deac668df3802e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Thu, 14 Sep 2023 11:45:51 +0000 Subject: [PATCH] Tests: Split tests for _inject_theme_attribute_in_template_part_block Follow-up to [56578]. See #59338. git-svn-id: https://develop.svn.wordpress.org/trunk@56584 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/block-template-utils.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php index ed680b7200..bb8a25cba6 100644 --- a/tests/phpunit/tests/block-template-utils.php +++ b/tests/phpunit/tests/block-template-utils.php @@ -257,8 +257,14 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase { $actual, '`theme` attribute was not correctly injected in template part block.' ); + } - // Does not inject theme when there is an existing theme attribute. + /** + * @ticket 59338 + * + * @covers ::_inject_theme_attribute_in_template_part_block + */ + public function test_not_inject_theme_attribute_in_template_part_block_theme_attribute_exists() { $template_part_block_with_existing_theme_attribute = array( 'blockName' => 'core/template-part', 'attrs' => array( @@ -279,8 +285,14 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase { $actual, 'Existing `theme` attribute in template part block was not respected by attribute injection.' ); + } - // Does not inject theme when there is no template part. + /** + * @ticket 59338 + * + * @covers ::_inject_theme_attribute_in_template_part_block + */ + public function test_not_inject_theme_attribute_non_template_part_block() { $non_template_part_block = array( 'blockName' => 'core/post-content', 'attrs' => array(),