Skip to content

Commit f0e4735

Browse files
committed
fix false positive on test
1 parent 8b63fc7 commit f0e4735

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/phpunit/tests/template.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,10 @@ public function test_locate_template_uses_current_theme() {
511511
public function test_wp_start_template_enhancement_output_buffer_without_filters_and_no_override(): void {
512512
remove_all_filters( 'wp_template_enhancement_output_buffer' );
513513
$level = ob_get_level();
514-
$this->assertFalse( wp_should_output_buffer_template_for_enhancement(), 'Expected wp_should_output_buffer_template_for_enhancement() to return false when there are no wp_template_enhancement_output_buffer filters added.' );
515-
$this->assertFalse( wp_start_template_enhancement_output_buffer(), 'Expected wp_start_template_enhancement_output_buffer() to return false because the output buffer should not be started.' );
514+
if ( wp_is_block_theme() ) {
515+
$this->assertFalse( wp_should_output_buffer_template_for_enhancement(), 'Expected wp_should_output_buffer_template_for_enhancement() to return false when there are no wp_template_enhancement_output_buffer filters added.' );
516+
$this->assertFalse( wp_start_template_enhancement_output_buffer(), 'Expected wp_start_template_enhancement_output_buffer() to return false because the output buffer should not be started.' );
517+
}
516518
$this->assertSame( 0, did_action( 'wp_template_enhancement_output_buffer_started' ), 'Expected the wp_template_enhancement_output_buffer_started action to not have fired.' );
517519
$this->assertSame( $level, ob_get_level(), 'Expected the initial output buffer level to be unchanged.' );
518520
}

0 commit comments

Comments
 (0)