From 5e5e45758e5d9ee81547373fb954b63cfb70fd0e Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 5 Jun 2022 17:16:25 -0700 Subject: [PATCH] PHPCS --- tests/test-block-editor.php | 9 ++++++--- tests/test-hooks.php | 2 +- tests/test-misc.php | 2 +- tests/test-purges.php | 2 +- tests/test-ui.php | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/test-block-editor.php b/tests/test-block-editor.php index ee6c493..21ab5d8 100644 --- a/tests/test-block-editor.php +++ b/tests/test-block-editor.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Test block-editor features. * @@ -23,15 +23,18 @@ class TestBlockEditor extends WP_UnitTestCase { * @covers ::action_rest_api_init() */ public function test_action_rest_api_init() { + // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound global $wp_meta_keys, $wp_rest_server; $wp_meta_keys = null; $wp_rest_server = null; + // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $object_type = 'post'; $object_subtype = 'post'; // Prevent `_doing_it_wrong()` notice from `register_rest_route()`. remove_all_actions( 'rest_api_init' ); + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound do_action( 'rest_api_init' ); $this->assertEmpty( @@ -92,7 +95,7 @@ class TestBlockEditor extends WP_UnitTestCase { $request = new WP_REST_Request(); $request->set_param( 'id', $post_id ); - _set_cron_array( [] ); + _set_cron_array( array() ); $response = Block_Editor::get_instance()->rest_api_schedule_purge( $request ); $this->assertTrue( @@ -132,7 +135,7 @@ class TestBlockEditor extends WP_UnitTestCase { $request->set_param( 'id', $post_id ); $request->set_param( 'limit_override', $limit_override ); - _set_cron_array( [] ); + _set_cron_array( array() ); $response = Block_Editor::get_instance()->rest_api_schedule_purge( $request ); $this->assertTrue( diff --git a/tests/test-hooks.php b/tests/test-hooks.php index 920c9f6..0b500cc 100755 --- a/tests/test-hooks.php +++ b/tests/test-hooks.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Test WP hooks. * diff --git a/tests/test-misc.php b/tests/test-misc.php index fcec10e..134ad64 100755 --- a/tests/test-misc.php +++ b/tests/test-misc.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Test miscellaneous methods. * diff --git a/tests/test-purges.php b/tests/test-purges.php index 234dd5e..bc45a56 100755 --- a/tests/test-purges.php +++ b/tests/test-purges.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Test purge methods. * diff --git a/tests/test-ui.php b/tests/test-ui.php index f6f79ee..7fdbb05 100755 --- a/tests/test-ui.php +++ b/tests/test-ui.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Test UI methods. * -- GitLab