Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/phpunit/tests/blocks/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down Expand Up @@ -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' ),
Expand Down
10 changes: 5 additions & 5 deletions tests/phpunit/tests/blocks/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
); }

Expand Down Expand Up @@ -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;
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/blocks/supportedStyles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/blocks/wpBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
<!-- wp:static -->
<div class="static">
Expand Down Expand Up @@ -1508,7 +1508,7 @@ public function test_block_has_support_string( $block_data, $support, $expected,
/**
* Data provider for test_block_has_support_string
*/
public function data_block_has_support_string() {
public static function data_block_has_support_string() {
return array(
array(
array(),
Expand Down
10 changes: 5 additions & 5 deletions tests/phpunit/tests/blocks/wpBlockParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function test_default_parser_output( $html_filename, $parsed_json_filenam
/**
* @ticket 45109
*/
public function data_parsing_test_filenames() {
public static function data_parsing_test_filenames() {
self::$fixtures_dir = DIR_TESTDATA . '/blocks/fixtures';

$fixture_filenames = array_merge(
Expand All @@ -167,14 +167,14 @@ public function data_parsing_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
);
}
Expand All @@ -187,7 +187,7 @@ public function data_parsing_test_filenames() {
* @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;
Expand All @@ -201,7 +201,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.parsed.json",
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/blocks/wpBlockType.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function test_block_version( $content, $expected ) {
* }
* }
*/
public function data_block_version() {
public static function data_block_version() {
return array(
// Null.
array( null, 0 ),
Expand Down
Loading