From b705a0b75025dd49c787c9c1c04882d50e831820 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin <622599+aaronjorbin@users.noreply.github.com> Date: Thu, 19 Jun 2025 12:11:20 -0500 Subject: [PATCH] Try: Ensure tests from PR #8789 pass on 6.7 See: https://github.com/WordPress/wordpress-develop/pull/8789/files See: https://core.trac.wordpress.org/ticket/63325 --- tests/phpunit/tests/blocks/serialize.php | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/phpunit/tests/blocks/serialize.php b/tests/phpunit/tests/blocks/serialize.php index b4221ef3c5a15..5a529e60a04e1 100644 --- a/tests/phpunit/tests/blocks/serialize.php +++ b/tests/phpunit/tests/blocks/serialize.php @@ -10,6 +10,37 @@ * @group blocks */ class Tests_Blocks_Serialize extends WP_UnitTestCase { + /** + * Set up. + * + * @ticket 63325. + */ + public static function wpSetUpBeforeClass() { + register_block_type( + 'core/attributes', + array( + 'attributes' => array( + 'array' => array( + 'type' => 'array', + ), + 'object' => array( + 'type' => 'object', + ), + ), + ) + ); + } + + /** + * Tear down. + * + * @ticket 63325. + */ + public static function wpTearDownAfterClass() { + $registry = WP_Block_Type_Registry::get_instance(); + + $registry->unregister( 'core/attributes' ); + } /** * @dataProvider data_serialize_identity_from_parsed @@ -46,6 +77,12 @@ public function data_serialize_identity_from_parsed() { // Block with attribute values that should not be escaped. array( '' ), + + // Block with empty array attribute value. + array( '' ), + + // Block with empty object attribute value. + array( '' ), ); }