From 2e17f2bbf7f1a1b9f943c66f7789b63196406f16 Mon Sep 17 00:00:00 2001 From: Anton Vlasenko Date: Thu, 12 Dec 2024 01:06:45 +0100 Subject: [PATCH] Data providers should always be declared as static. Props @swisspidy. --- tests/phpunit/tests/rest-api/rest-categories-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-comments-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-posts-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-tags-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-users-controller.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-categories-controller.php b/tests/phpunit/tests/rest-api/rest-categories-controller.php index 514084f25f368..01bcc2ec12ddb 100644 --- a/tests/phpunit/tests/rest-api/rest-categories-controller.php +++ b/tests/phpunit/tests/rest-api/rest-categories-controller.php @@ -1313,7 +1313,7 @@ public function test_get_items_only_fetches_ids_for_head_requests( $method ) { * * @return array */ - public function data_readable_http_methods() { + public static function data_readable_http_methods() { return array( 'GET request' => array( 'GET' ), 'HEAD request' => array( 'HEAD' ), diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index 6aeca24e5e97c..30ea3b67fd369 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -452,7 +452,7 @@ public function test_get_items_no_permission_for_no_post( $method ) { * * @return array */ - public function data_readable_http_methods() { + public static function data_readable_http_methods() { return array( 'GET request' => array( 'GET' ), 'HEAD request' => array( 'HEAD' ), diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index 1a6b5cc381c7d..04ff7ab9a122a 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -1945,7 +1945,7 @@ public function test_get_items_pagination_headers( $method ) { * * @return array */ - public function data_readable_http_methods() { + public static function data_readable_http_methods() { return array( 'GET request' => array( 'GET' ), 'HEAD request' => array( 'HEAD' ), diff --git a/tests/phpunit/tests/rest-api/rest-tags-controller.php b/tests/phpunit/tests/rest-api/rest-tags-controller.php index c0b478d98fd5f..d32f942f3d0ff 100644 --- a/tests/phpunit/tests/rest-api/rest-tags-controller.php +++ b/tests/phpunit/tests/rest-api/rest-tags-controller.php @@ -1567,7 +1567,7 @@ public function test_get_items_only_fetches_ids_for_head_requests( $method ) { * * @return array */ - public function data_readable_http_methods() { + public static function data_readable_http_methods() { return array( 'GET request' => array( 'GET' ), 'HEAD request' => array( 'HEAD' ), diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 0a42b4ff75e33..333c83c498017 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -268,7 +268,7 @@ public function test_get_items_with_edit_context( $method ) { * * @return array */ - public function data_readable_http_methods() { + public static function data_readable_http_methods() { return array( 'GET request' => array( 'GET' ), 'HEAD request' => array( 'HEAD' ),