From 9982d05fcbdfd2d072621a6844de818959b72b38 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 31 May 2024 09:46:51 -0500 Subject: [PATCH] Clear theme json data between theme unit tests --- tests/phpunit/tests/theme/base.php | 1 + tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/phpunit/tests/theme/base.php b/tests/phpunit/tests/theme/base.php index 182efa5df81e4..4c42fa3363b0a 100644 --- a/tests/phpunit/tests/theme/base.php +++ b/tests/phpunit/tests/theme/base.php @@ -44,6 +44,7 @@ public function tear_down() { remove_filter( 'template_root', array( $this, 'filter_set_theme_root' ) ); wp_clean_themes_cache(); + wp_clean_theme_json_cache(); unset( $GLOBALS['wp_themes'] ); parent::tear_down(); diff --git a/tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php b/tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php index 9814a6ae68c0a..7d34e8d2a6b33 100644 --- a/tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php +++ b/tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php @@ -131,6 +131,7 @@ public function test_third_party_blocks_inline_styles_get_rendered_when_per_bloc * @ticket 61165 */ public function test_blocks_inline_styles_get_rendered() { + $this->set_up_third_party_block(); wp_register_style( 'global-styles', false, array(), true, true ); wp_enqueue_style( 'global-styles' ); wp_add_global_styles_for_blocks(); @@ -174,6 +175,7 @@ public function test_third_party_blocks_inline_styles_for_elements_get_rendered_ * @ticket 61165 */ public function test_third_party_blocks_inline_styles_for_elements_get_rendered() { + $this->set_up_third_party_block(); wp_register_style( 'global-styles', false, array(), true, true ); wp_enqueue_style( 'global-styles' ); wp_add_global_styles_for_blocks();