Changeset 55086 for trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
- Timestamp:
- 01/18/2023 11:38:16 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r55067 r55086 111 111 112 112 // Reset data between tests. 113 WP_Theme_JSON_Resolver::clean_cached_data();113 wp_clean_theme_json_cache(); 114 114 parent::tear_down(); 115 115 } … … 377 377 */ 378 378 public function test_get_core_data( $should_fire_filter, $core_is_cached, $blocks_are_cached ) { 379 WP_Theme_JSON_Resolver::clean_cached_data();379 wp_clean_theme_json_cache(); 380 380 381 381 // If should cache core, then fire the method to cache it before running the tests. … … 430 430 ), 431 431 ); 432 }433 434 /**435 * @ticket 52991436 */437 public function test_switching_themes_recalculates_data() {438 // The "default" theme doesn't have theme.json support.439 switch_theme( 'default' );440 $default = WP_Theme_JSON_Resolver::theme_has_support();441 442 // Switch to a theme that does have support.443 switch_theme( 'block-theme' );444 $has_theme_json_support = WP_Theme_JSON_Resolver::theme_has_support();445 446 $this->assertFalse( $default );447 $this->assertTrue( $has_theme_json_support );448 432 } 449 433 … … 483 467 remove_theme_support( 'appearance-tools' ); 484 468 485 $this->assertFalse( WP_Theme_JSON_Resolver::theme_has_support() );469 $this->assertFalse( wp_theme_has_theme_json() ); 486 470 $this->assertTrue( $settings['typography']['lineHeight'] ); 487 471 $this->assertSame( $color_palette, $settings['color']['palette']['theme'] ); … … 644 628 for ( $i = 0; $i < 3; $i++ ) { 645 629 WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme ); 646 WP_Theme_JSON_Resolver::clean_cached_data();630 wp_clean_theme_json_cache(); 647 631 } 648 632 $this->assertSame( 0, $global_styles_query_count, 'Unexpected SQL queries detected for the wp_global_style post type prior to creation.' ); … … 657 641 for ( $i = 0; $i < 3; $i++ ) { 658 642 $new_user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme ); 659 WP_Theme_JSON_Resolver::clean_cached_data();643 wp_clean_theme_json_cache(); 660 644 $this->assertSameSets( $user_cpt, $new_user_cpt, "User CPTs do not match on run {$i}." ); 661 645 } … … 674 658 for ( $i = 0; $i < 3; $i++ ) { 675 659 WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme ); 676 WP_Theme_JSON_Resolver::clean_cached_data();660 wp_clean_theme_json_cache(); 677 661 } 678 662 $query_count = get_num_queries() - $query_count;
Note: See TracChangeset
for help on using the changeset viewer.