mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -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'] );
|
||||
|
||||
Reference in New Issue
Block a user