diff --git a/tests/phpunit/tests/template.php b/tests/phpunit/tests/template.php index 35003da308fbf..b319d9f2aa668 100644 --- a/tests/phpunit/tests/template.php +++ b/tests/phpunit/tests/template.php @@ -1514,7 +1514,7 @@ public function test_wp_load_classic_theme_block_styles_on_demand( string $theme * assert?: Closure( string, string ): void, * }> */ - public function data_wp_hoist_late_printed_styles(): array { + public static function data_wp_hoist_late_printed_styles(): array { $blocks_content = '
This is only a test!
'; $early_common_styles = array( @@ -1718,7 +1718,7 @@ static function () { ), 'BODY' => array(), ), - 'assert' => function ( string $buffer, string $filtered_buffer ) { + 'assert' => static function ( string $buffer, string $filtered_buffer ) { $block_separator_core_style_span = null; $block_separator_custom_style_span = null; $processor = new class( $filtered_buffer ) extends WP_HTML_Tag_Processor { @@ -1743,9 +1743,9 @@ public function get_span(): WP_HTML_Span { } } - $this->assertInstanceOf( WP_HTML_Span::class, $block_separator_core_style_span, 'Expected the block separator core style to be present.' ); - $this->assertInstanceOf( WP_HTML_Span::class, $block_separator_custom_style_span, 'Expected the block separator custom style to be present.' ); - $this->assertGreaterThan( $block_separator_core_style_span->start, $block_separator_custom_style_span->start, 'Expected the block separator custom style to appear after the block separator stylesheet.' ); + self::assertInstanceOf( WP_HTML_Span::class, $block_separator_core_style_span, 'Expected the block separator core style to be present.' ); + self::assertInstanceOf( WP_HTML_Span::class, $block_separator_custom_style_span, 'Expected the block separator custom style to be present.' ); + self::assertGreaterThan( $block_separator_core_style_span->start, $block_separator_custom_style_span->start, 'Expected the block separator custom style to appear after the block separator stylesheet.' ); }, ), @@ -1779,14 +1779,14 @@ static function () { ), 'BODY' => array(), ), - 'assert' => function ( string $buffer, string $filtered_buffer ) { + 'assert' => static function ( string $buffer, string $filtered_buffer ) { $block_separator_inline_style_start_tag = '