Skip to content

Commit 3e6213e

Browse files
committed
Tidy tests
1 parent 49520fa commit 3e6213e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/phpunit/tests/template.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ public function test_wp_start_template_enhancement_output_buffer_for_json(): voi
894894
}
895895

896896
/**
897-
* Tests that wp_load_block_styles_on_demand_in_classic_themes() does not add filters for block themes.
897+
* Tests that wp_load_block_styles_on_demand_in_classic_themes() does not add hooks for block themes.
898898
*
899899
* @ticket 64099
900900
* @covers ::wp_load_block_styles_on_demand_in_classic_themes
@@ -910,7 +910,7 @@ public function test_wp_load_block_styles_on_demand_in_classic_themes_in_block_t
910910
}
911911

912912
/**
913-
* Tests that wp_load_block_styles_on_demand_in_classic_themes() does not add filters for classic themes then output buffering is blocked.
913+
* Tests that wp_load_block_styles_on_demand_in_classic_themes() does not add hooks for classic themes when output buffering is blocked.
914914
*
915915
* @ticket 64099
916916
* @covers ::wp_load_block_styles_on_demand_in_classic_themes
@@ -927,22 +927,23 @@ public function test_wp_load_block_styles_on_demand_in_classic_themes_in_classic
927927
}
928928

929929
/**
930-
* Tests that wp_always_load_block_styles_on_demand adds the expected filters for classic themes.
930+
* Tests that wp_load_block_styles_on_demand_in_classic_themes() adds the expected hooks for classic themes.
931931
*
932932
* @ticket 64099
933933
* @covers ::wp_load_block_styles_on_demand_in_classic_themes
934934
*/
935935
public function test_wp_load_block_styles_on_demand_in_classic_themes_in_classic_theme(): void {
936936
switch_theme( 'default' );
937937

938+
$this->assertFalse( wp_should_load_separate_core_block_assets(), 'Expected wp_should_load_separate_core_block_assets() to return false initially.' );
939+
$this->assertFalse( wp_should_load_block_assets_on_demand(), 'Expected wp_should_load_block_assets_on_demand() to return true' );
940+
$this->assertFalse( has_action( 'wp_template_enhancement_output_buffer_started', 'wp_hoist_late_printed_styles' ), 'Expected wp_template_enhancement_output_buffer_started action to be added for classic themes.' );
941+
938942
wp_load_block_styles_on_demand_in_classic_themes();
939943

940-
$default = null;
941-
$this->assertTrue( has_filter( 'should_load_separate_core_block_assets' ), 'Expect should_load_separate_core_block_assets filter to be added for classic themes.' );
942-
$this->assertTrue( apply_filters( 'should_load_separate_core_block_assets', $default ), 'Expect should_load_separate_core_block_assets filters to return true' );
943-
$this->assertTrue( has_filter( 'should_load_block_assets_on_demand' ), 'Expect should_load_block_assets_on_demand filter to be added for classic themes.' );
944-
$this->assertTrue( apply_filters( 'should_load_block_assets_on_demand', $default ), 'Expect should_load_separate_core_block_assets filters to return true' );
945-
$this->assertNotFalse( has_action( 'wp_template_enhancement_output_buffer_started', 'wp_hoist_late_printed_styles' ), 'Expect wp_template_enhancement_output_buffer_started filter to be added for classic themes.' );
944+
$this->assertTrue( wp_should_load_separate_core_block_assets(), 'Expected wp_should_load_separate_core_block_assets() filters to return true' );
945+
$this->assertTrue( wp_should_load_block_assets_on_demand(), 'Expected wp_should_load_block_assets_on_demand() to return true' );
946+
$this->assertNotFalse( has_action( 'wp_template_enhancement_output_buffer_started', 'wp_hoist_late_printed_styles' ), 'Expected wp_template_enhancement_output_buffer_started action to be added for classic themes.' );
946947
}
947948

948949
/**

0 commit comments

Comments
 (0)