From 36bc1177cd6d4549db37e7f402f2112f4aedc250 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 1 Sep 2022 18:42:56 +0000 Subject: [PATCH] Tests: Correct the `@covers` tag in a `WP_REST_Posts_Controller` test for unique post slugs. This addresses a notice when generating the code coverage report: {{{ "@covers WP_REST_Request::create_item" is invalid }}} The `WP_REST_Request` class does not have a `create_item()` method, `WP_REST_Posts_Controller` is the class being tested here. Includes fixing a typo in the test method name. Follow-up to [53813]. See #52422, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54055 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-posts-controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index 5b2fbc27fc..e4758a80c8 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -5252,9 +5252,9 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te /** * @ticket 52422 * - * @covers WP_REST_Request::create_item + * @covers WP_REST_Posts_Controller::create_item */ - public function test_draft_post_do_not_have_the_same_slug_as_existing_post() { + public function test_draft_post_does_not_have_the_same_slug_as_existing_post() { wp_set_current_user( self::$editor_id ); $this->factory()->post->create( array( 'post_name' => 'sample-slug' ) );