@@ -20,6 +20,7 @@ class Tests_Theme_WpAddGlobalStylesForBlocks extends WP_Theme_UnitTestCase {
2020
2121 public function set_up () {
2222 parent ::set_up ();
23+ switch_theme ( 'default ' );
2324 remove_action ( 'wp_print_styles ' , 'print_emoji_styles ' );
2425 }
2526
@@ -32,6 +33,7 @@ public function tear_down() {
3233 $ this ->test_blocks = array ();
3334 }
3435
36+ switch_theme ( 'default ' );
3537 parent ::tear_down ();
3638 }
3739
@@ -126,6 +128,7 @@ public function test_styles_for_blocks_skips_cache_in_dev_mode() {
126128 * @ticket 59595
127129 */
128130 public function test_styles_for_blocks_cache_is_skipped () {
131+ switch_theme ( 'block-theme ' );
129132 wp_register_style ( 'global-styles ' , false , array (), true , true );
130133
131134 // Initial register of global styles.
@@ -136,15 +139,14 @@ public function test_styles_for_blocks_cache_is_skipped() {
136139 $ this ->assertNotEmpty ( $ styles_for_blocks_initial , 'Initial cache was not set. ' );
137140
138141 $ this ->set_up_third_party_block ();
139-
140142 /*
141143 * Call register of global styles again to ensure the cache is updated.
142144 * In normal conditions, this function is only called once per request.
143145 */
144146 wp_add_global_styles_for_blocks ();
145147
146- $ cache_key = $ this ->get_wp_styles_for_blocks_cache_key ();
147- $ styles_for_blocks_updated = get_site_transient ( $ cache_key );
148+ $ cache_key_new = $ this ->get_wp_styles_for_blocks_cache_key ();
149+ $ styles_for_blocks_updated = get_site_transient ( $ cache_key_new );
148150 $ this ->assertNotEmpty ( $ styles_for_blocks_updated , 'Updated cache was not set. ' );
149151
150152 $ this ->assertNotEquals (
0 commit comments