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
This commit is contained in:
parent
b9de0d7f10
commit
c7f1aeb441
|
@ -2835,7 +2835,6 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
|
||||||
$request->set_param( 'force', 'false' );
|
$request->set_param( 'force', 'false' );
|
||||||
$response = $this->server->dispatch( $request );
|
$response = $this->server->dispatch( $request );
|
||||||
|
|
||||||
$this->assertNotInstanceOf( 'WP_Error', $response );
|
|
||||||
$this->assertEquals( 200, $response->get_status() );
|
$this->assertEquals( 200, $response->get_status() );
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
$this->assertEquals( 'Deleted post', $data['title']['raw'] );
|
$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;
|
$request['force'] = true;
|
||||||
$response = $this->server->dispatch( $request );
|
$response = $this->server->dispatch( $request );
|
||||||
|
|
||||||
$this->assertNotInstanceOf( 'WP_Error', $response );
|
|
||||||
$this->assertEquals( 200, $response->get_status() );
|
$this->assertEquals( 200, $response->get_status() );
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
$this->assertTrue( $data['deleted'] );
|
$this->assertTrue( $data['deleted'] );
|
||||||
|
|
Loading…
Reference in New Issue