From 7f58f469126d93ce0eaf6ce4e5c9ac8b49b2420b Mon Sep 17 00:00:00 2001 From: rejaulalomkhan Date: Tue, 27 Oct 2026 11:09:30 +0600 Subject: [PATCH] Tests: Make data providers in tests/phpunit/tests/blocks/register.php public and static Data providers should be declared public static to align with modern PHPUnit best practices and requirements. See #66211. --- tests/phpunit/tests/blocks/register.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php index 548be49271c40..1ffc91a486fa0 100644 --- a/tests/phpunit/tests/blocks/register.php +++ b/tests/phpunit/tests/blocks/register.php @@ -754,7 +754,7 @@ public function test_register_block_style_handle_uses_correct_core_stylesheet( $ } } - public function data_register_block_style_handle_uses_correct_core_stylesheet() { + public static function data_register_block_style_handle_uses_correct_core_stylesheet() { return array( 'block with style' => array( WPINC . '/blocks/archives/block.json', @@ -1078,7 +1078,7 @@ public function test_block_registers_with_args_override_returns_false_when_name_ * * @return array[] */ - public function data_register_block_registers_with_args_override_returns_false_when_name_is_missing() { + public static function data_register_block_registers_with_args_override_returns_false_when_name_is_missing() { return array( 'no block.json file and no name argument' => array( 'file' => '', // No block.json file. @@ -1350,7 +1350,7 @@ public function test_register_block_type_accepts_editor_script_array( $editor_sc * * @return array */ - public function data_register_block_type_accepts_editor_script_array() { + public static function data_register_block_type_accepts_editor_script_array() { return array( 'an empty array' => array( 'editor_script' => array(), @@ -1416,7 +1416,7 @@ public function test_register_block_type_throws_doing_it_wrong( $editor_script, * * @return array */ - public function data_register_block_type_throws_doing_it_wrong() { + public static function data_register_block_type_throws_doing_it_wrong() { return array( 'a non-string array' => array( 'editor_script' => array( null, false, true, -1, 0, 1, -1.0, 0.0, 1.0, INF, NAN, new stdClass() ), @@ -1607,7 +1607,7 @@ public function test_register_block_style_name_contains_spaces( array $block_sty * * @return array */ - public function data_register_block_style_name_contains_spaces() { + public static function data_register_block_style_name_contains_spaces() { return array( 'multiple spaces' => array( array(