diff --git a/tests/phpunit/tests/blocks/editor.php b/tests/phpunit/tests/blocks/editor.php index c5755ff434b82..5055aab4d999e 100644 --- a/tests/phpunit/tests/blocks/editor.php +++ b/tests/phpunit/tests/blocks/editor.php @@ -375,7 +375,7 @@ public function test_get_default_block_editor_settings_auto_attach_media_enabled * * @return array[] */ - public function data_get_default_block_editor_settings_auto_attach_media_enabled() { + public static function data_get_default_block_editor_settings_auto_attach_media_enabled() { return array( 'attachment pages disabled' => array( 0, true ), 'attachment pages enabled' => array( 1, false ), @@ -831,7 +831,7 @@ public function test_get_classic_theme_supports_block_editor_settings() { * * @return array */ - public function data_block_editor_rest_api_preload_adds_missing_leading_slash() { + public static function data_block_editor_rest_api_preload_adds_missing_leading_slash() { return array( 'a string without a slash' => array( 'preload_paths' => array( 'wp/v2/blocks' ), diff --git a/tests/phpunit/tests/blocks/render.php b/tests/phpunit/tests/blocks/render.php index 7b20dac147601..7791c7d7c94e7 100644 --- a/tests/phpunit/tests/blocks/render.php +++ b/tests/phpunit/tests/blocks/render.php @@ -183,7 +183,7 @@ public function test_blocks_arent_autopeed() { /** * @ticket 45109 */ - public function data_do_block_test_filenames() { + public static function data_do_block_test_filenames() { self::$fixtures_dir = DIR_TESTDATA . '/blocks/fixtures'; $fixture_filenames = array_merge( @@ -194,14 +194,14 @@ public function data_do_block_test_filenames() { $fixture_filenames = array_values( array_unique( array_map( - array( $this, 'clean_fixture_filename' ), + array( __CLASS__, 'clean_fixture_filename' ), $fixture_filenames ) ) ); return array_map( - array( $this, 'pass_parser_fixture_filenames' ), + array( __CLASS__, 'pass_parser_fixture_filenames' ), $fixture_filenames ); } @@ -476,7 +476,7 @@ public function test_dynamic_block_gets_rendered_inner_dynamic_blocks() { * @param string $filename The filename to clean. * @return string The cleaned fixture name. */ - protected function clean_fixture_filename( $filename ) { + protected static function clean_fixture_filename( $filename ) { $filename = wp_basename( $filename ); $filename = preg_replace( '/\..+$/', '', $filename ); return $filename; @@ -490,7 +490,7 @@ protected function clean_fixture_filename( $filename ) { * @param string $filename The cleaned fixture name. * @return array The input and expected output filenames for that fixture. */ - protected function pass_parser_fixture_filenames( $filename ) { + protected static function pass_parser_fixture_filenames( $filename ) { return array( "$filename.html", "$filename.server.html", diff --git a/tests/phpunit/tests/blocks/supportedStyles.php b/tests/phpunit/tests/blocks/supportedStyles.php index a6fd8b598a28f..6f7d11bdc015a 100644 --- a/tests/phpunit/tests/blocks/supportedStyles.php +++ b/tests/phpunit/tests/blocks/supportedStyles.php @@ -800,7 +800,7 @@ public function test_get_block_wrapper_attributes_merge_and_override( array $blo * expected_attribute: string * }> Array of test cases. */ - public function data_get_block_wrapper_attributes_merge_or_override(): array { + public static function data_get_block_wrapper_attributes_merge_or_override(): array { return array( 'extra style attributes are merged with block values' => array( 'block_type_settings' => array( diff --git a/tests/phpunit/tests/blocks/wpBlock.php b/tests/phpunit/tests/blocks/wpBlock.php index ab75616a7ec3a..3095400b9262c 100644 --- a/tests/phpunit/tests/blocks/wpBlock.php +++ b/tests/phpunit/tests/blocks/wpBlock.php @@ -365,7 +365,7 @@ public function test_render_applies_dynamic_render_block_filter() { * * @return array */ - public function data_provider_test_render_enqueues_scripts_and_styles(): array { + public static function data_provider_test_render_enqueues_scripts_and_styles(): array { $block_markup = <<<'HTML'