- Timestamp:
- 06/26/2023 07:55:28 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpGetGlobalStylesheet.php
r55572 r56042 222 222 223 223 /** 224 * Tests that the function relies on the development mode for whether to use caching. 225 * 226 * @ticket 57487 227 */ 228 public function test_caching_is_used_when_developing_theme() { 229 global $_wp_tests_development_mode; 230 231 $this->maybe_switch_theme( 'block-theme' ); 232 233 // Store CSS in cache. 234 $css = '.my-class { display: block; }'; 235 wp_cache_set( 'wp_get_global_stylesheet', $css, 'theme_json' ); 236 237 // By default, caching should be used, so the above value will be returned. 238 $_wp_tests_development_mode = ''; 239 $this->assertSame( $css, wp_get_global_stylesheet(), 'Caching was not used despite development mode disabled' ); 240 241 // When the development mode is set to 'theme', caching should not be used. 242 $_wp_tests_development_mode = 'theme'; 243 $this->assertNotSame( $css, wp_get_global_stylesheet(), 'Caching was used despite theme development mode' ); 244 } 245 246 /** 224 247 * Adds the 'editor-font-sizes' theme support with custom font sizes. 225 248 *
Note: See TracChangeset
for help on using the changeset viewer.