From c7f1aeb4411376a8d19fc9ce5441b6c147dba61d Mon Sep 17 00:00:00 2001 From: James Nylen Date: Wed, 29 Mar 2017 17:05:41 +0000 Subject: [PATCH] Tests: Remove a couple of invalid error assertions. A couple of REST API tests had an assertion `assertNotInstanceOf( 'WP_Error', $response );` which will never be true. Since these assertions are invalid, and also made redundant by the response status check, we can just remove them. Props dlh. Fixes #40270. git-svn-id: https://develop.svn.wordpress.org/trunk@40350 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-posts-controller.php | 2 -- 1 file changed, 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 409982eed8..3aa91e4977 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -2835,7 +2835,6 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te $request->set_param( 'force', 'false' ); $response = $this->server->dispatch( $request ); - $this->assertNotInstanceOf( 'WP_Error', $response ); $this->assertEquals( 200, $response->get_status() ); $data = $response->get_data(); $this->assertEquals( 'Deleted post', $data['title']['raw'] ); @@ -2850,7 +2849,6 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te $request['force'] = true; $response = $this->server->dispatch( $request ); - $this->assertNotInstanceOf( 'WP_Error', $response ); $this->assertEquals( 200, $response->get_status() ); $data = $response->get_data(); $this->assertTrue( $data['deleted'] );