Make WordPress Core

Changeset 58295


Ignore:
Timestamp:
06/03/2024 03:03:18 PM (8 months ago)
Author:
joemcgill
Message:

Build/Test Tools: Reduce cross-pollution in Tests_Theme_WpAddGlobalStylesForBlocks.

This ensures cached Theme JSON data is cleared between all test classes that extend WP_Theme_UnitTestCase and fixes a few tests that would fail in isolation, even though they full test suite would pass.

Props isabel_brison, thekt12, joemcgill.
Fixes #61337.

Location:
trunk/tests/phpunit/tests/theme
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/base.php

    r54703 r58295  
    4545
    4646        wp_clean_themes_cache();
     47        wp_clean_theme_json_cache();
    4748        unset( $GLOBALS['wp_themes'] );
    4849
  • trunk/tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php

    r58241 r58295  
    132132     */
    133133    public function test_blocks_inline_styles_get_rendered() {
     134        $this->set_up_third_party_block();
    134135        wp_register_style( 'global-styles', false, array(), true, true );
    135136        wp_enqueue_style( 'global-styles' );
     
    175176     */
    176177    public function test_third_party_blocks_inline_styles_for_elements_get_rendered() {
     178        $this->set_up_third_party_block();
    177179        wp_register_style( 'global-styles', false, array(), true, true );
    178180        wp_enqueue_style( 'global-styles' );
Note: See TracChangeset for help on using the changeset viewer.