Changeset 59823 for trunk/tests/phpunit/tests/theme.php
- Timestamp:
- 02/14/2025 06:36:48 PM (13 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme.php
r59579 r59823 967 967 968 968 /** 969 * Tests that block themes load block assets on demand by default. 970 * 971 * @ticket 61965 972 * 973 * @covers ::_add_default_theme_supports 974 * @covers ::wp_should_load_block_assets_on_demand 975 */ 976 public function test_block_theme_should_load_block_assets_on_demand_by_default() { 977 $this->helper_requires_block_theme(); 978 979 add_filter( 'should_load_block_assets_on_demand', '__return_false' ); 980 981 $this->assertFalse( 982 wp_should_load_block_assets_on_demand(), 983 'Could not disable loading block assets on demand.' 984 ); 985 986 do_action( 'after_setup_theme' ); 987 add_filter( 'should_load_separate_core_block_assets', '__return_false' ); 988 989 $this->assertTrue( 990 wp_should_load_block_assets_on_demand(), 991 'Block themes do not load block assets on demand by default.' 992 ); 993 } 994 995 /** 996 * Tests that block themes load block assets on demand by default even when loading separate core block assets is disabled. 997 * 998 * @ticket 61965 999 * 1000 * @covers ::_add_default_theme_supports 1001 * @covers ::wp_should_load_block_assets_on_demand 1002 */ 1003 public function test_block_theme_should_load_block_assets_on_demand_by_default_even_with_separate_core_block_assets_disabled() { 1004 $this->helper_requires_block_theme(); 1005 1006 do_action( 'after_setup_theme' ); 1007 add_filter( 'should_load_separate_core_block_assets', '__return_false' ); 1008 1009 $this->assertTrue( wp_should_load_block_assets_on_demand() ); 1010 } 1011 1012 /** 969 1013 * Tests that a theme in the custom test data theme directory is recognized. 970 1014 *
Note: See TracChangeset
for help on using the changeset viewer.