- Timestamp:
- 06/26/2023 07:55:28 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpGetGlobalStylesSvgFilters.php
r55185 r56042 35 35 $this->assertNotSame( $svg_for_default_theme, $svg_for_block_theme, 'Cache value should have changed' ); 36 36 } 37 38 /** 39 * Tests that the function relies on the development mode for whether to use caching. 40 * 41 * @ticket 57487 42 * 43 * @covers ::wp_get_global_styles_svg_filters 44 */ 45 public function test_caching_is_used_when_developing_theme() { 46 global $_wp_tests_development_mode; 47 48 switch_theme( 'block-theme' ); 49 50 // Store SVG in cache. 51 $svg = '<svg></svg>'; 52 wp_cache_set( 'wp_get_global_styles_svg_filters', $svg, 'theme_json' ); 53 54 // By default, caching should be used, so the above value will be returned. 55 $_wp_tests_development_mode = ''; 56 $this->assertSame( $svg, wp_get_global_styles_svg_filters(), 'Caching was not used despite development mode disabled' ); 57 58 // When the development mode is set to 'theme', caching should not be used. 59 $_wp_tests_development_mode = 'theme'; 60 $this->assertNotSame( $svg, wp_get_global_styles_svg_filters(), 'Caching was used despite theme development mode' ); 61 } 37 62 }
Note: See TracChangeset
for help on using the changeset viewer.