Changeset 61122 for trunk/tests/phpunit/tests/template.php
- Timestamp:
- 11/04/2025 07:53:24 AM (10 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/template.php
r61120 r61122 1394 1394 public function data_wp_load_classic_theme_block_styles_on_demand(): array { 1395 1395 return array( 1396 'block_theme' => array(1396 'block_theme' => array( 1397 1397 'theme' => 'block-theme', 1398 1398 'set_up' => static function () {}, 1399 'expected_on_demand' => false, 1399 'expected_load_separate' => true, 1400 'expected_on_demand' => true, 1400 1401 'expected_buffer_started' => false, 1401 1402 ), 1402 'classic_theme_with_output_buffer_blocked' => array(1403 'classic_theme_with_output_buffer_blocked' => array( 1403 1404 'theme' => 'default', 1404 1405 'set_up' => static function () { 1405 1406 add_filter( 'wp_should_output_buffer_template_for_enhancement', '__return_false' ); 1406 1407 }, 1408 'expected_load_separate' => false, 1407 1409 'expected_on_demand' => false, 1408 1410 'expected_buffer_started' => false, 1409 1411 ), 1410 'classic_theme_with_ block_styles_support'=> array(1412 'classic_theme_with_should_load_separate_core_block_assets_opt_out' => array( 1411 1413 'theme' => 'default', 1412 1414 'set_up' => static function () { 1413 add_theme_support( 'wp-block-styles' ); 1414 }, 1415 add_filter( 'should_load_separate_core_block_assets', '__return_false' ); 1416 }, 1417 'expected_load_separate' => false, 1418 'expected_on_demand' => true, 1419 'expected_buffer_started' => false, 1420 ), 1421 'classic_theme_with_should_load_block_assets_on_demand_out_out' => array( 1422 'theme' => 'default', 1423 'set_up' => static function () { 1424 add_filter( 'should_load_block_assets_on_demand', '__return_false' ); 1425 }, 1426 'expected_load_separate' => true, 1427 'expected_on_demand' => false, 1428 'expected_buffer_started' => false, 1429 ), 1430 'classic_theme_without_any_opt_out' => array( 1431 'theme' => 'default', 1432 'set_up' => static function () {}, 1433 'expected_load_separate' => true, 1415 1434 'expected_on_demand' => true, 1416 1435 'expected_buffer_started' => true, 1417 1436 ), 1418 'classic_theme_without_block_styles_support' => array(1419 'theme' => 'default',1420 'set_up' => static function () {1421 remove_theme_support( 'wp-block-styles' );1422 },1423 'expected_on_demand' => false,1424 'expected_buffer_started' => true,1425 ),1426 1437 ); 1427 1438 } … … 1437 1448 * @dataProvider data_wp_load_classic_theme_block_styles_on_demand 1438 1449 */ 1439 public function test_wp_load_classic_theme_block_styles_on_demand( string $theme, ?Closure $set_up, bool $expected_ on_demand, bool $expected_buffer_started ) {1450 public function test_wp_load_classic_theme_block_styles_on_demand( string $theme, ?Closure $set_up, bool $expected_load_separate, bool $expected_on_demand, bool $expected_buffer_started ) { 1440 1451 $this->assertFalse( wp_should_load_separate_core_block_assets(), 'Expected wp_should_load_separate_core_block_assets() to return false initially.' ); 1441 1452 $this->assertFalse( wp_should_load_block_assets_on_demand(), 'Expected wp_should_load_block_assets_on_demand() to return true' ); … … 1448 1459 1449 1460 wp_load_classic_theme_block_styles_on_demand(); 1450 1451 $this->assertSame( $expected_on_demand, wp_should_load_separate_core_block_assets(), 'Expected wp_should_load_separate_core_block_assets() return value.' ); 1461 _add_default_theme_supports(); 1462 1463 $this->assertSame( $expected_load_separate, wp_should_load_separate_core_block_assets(), 'Expected wp_should_load_separate_core_block_assets() return value.' ); 1452 1464 $this->assertSame( $expected_on_demand, wp_should_load_block_assets_on_demand(), 'Expected wp_should_load_block_assets_on_demand() return value.' ); 1453 1465 $this->assertSame( $expected_buffer_started, (bool) has_action( 'wp_template_enhancement_output_buffer_started', 'wp_hoist_late_printed_styles' ), 'Expected wp_template_enhancement_output_buffer_started action added status.' );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)