@@ -831,8 +831,8 @@ public function test_wp_start_template_enhancement_output_buffer_for_json(): voi
831831 }
832832
833833 // public function test_wp_always_load_block_styles_on_demand_init_in_block_theme(): void {
834- // // If we're in a block theme, expect no filters to be added.
835-
834+ // // If we're in a block theme, expect no filters to be added.
835+
836836 // }
837837
838838 /**
@@ -858,34 +858,34 @@ public function test_wp_always_load_block_styles_on_demand_init_in_classic_theme
858858 * @covers ::wp_use_placeholder_for_delayed_css
859859 */
860860 public function test_wp_use_placeholder_for_delayed_css (): void {
861-
861+
862862 // Enqueue a style
863863 wp_enqueue_style ( 'test-style ' , 'http://example.com/style.css ' );
864-
864+
865865 wp_use_placeholder_for_delayed_css ();
866-
866+
867867 // Simulate wp_head
868868 ob_start ();
869869 do_action ( 'wp_head ' );
870870 $ head_output = ob_get_clean ();
871-
871+
872872 $ this ->assertMatchesRegularExpression ( '/<!--late_styles:[a-f0-9-]{36}-->/ ' , $ head_output , 'Expect the placeholder to be present ' );
873873 $ this ->assertStringContainsString ( 'test-style ' , $ head_output , 'Expect the enqueued stylesheet to be present ' );
874-
874+
875875 // Enqueue a late style (after wp_head)
876876 wp_enqueue_style ( 'test-late-style ' , 'http://example.com/late-style.css ' );
877-
877+
878878 // Simulate footer scripts
879879 ob_start ();
880880 do_action ( 'wp_print_footer_scripts ' );
881881 $ footer_output = ob_get_clean ();
882-
882+
883883 // Create a complete HTML buffer
884884 $ buffer = '<html><head> ' . $ head_output . '</head><body>Content ' . $ footer_output . '</body></html> ' ;
885-
885+
886886 // Apply the output buffer filter
887887 $ filtered_buffer = apply_filters ( 'wp_template_enhancement_output_buffer ' , $ buffer );
888-
888+
889889 preg_match ( '/<head>(.+?)<\/head>/s ' , $ filtered_buffer , $ head_matches );
890890 $ this ->assertNotEmpty ( $ head_matches , 'Expect the late enqueued styles to be present in the header ' );
891891 $ this ->assertStringContainsString ( 'test-late-style ' , $ head_matches [1 ], 'Expect the late enqueued styles to be present in the header ' );
0 commit comments