Ticket #40270: 40270.diff
| File 40270.diff, 2.7 KB (added by , 9 years ago) |
|---|
-
tests/phpunit/includes/testcase-rest-post-type-controller.php
202 202 protected function check_get_posts_response( $response, $context = 'view' ) { 203 203 $this->assertNotInstanceOf( 'WP_Error', $response ); 204 204 $response = rest_ensure_response( $response ); 205 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 205 206 $this->assertEquals( 200, $response->get_status() ); 206 207 207 208 $headers = $response->get_headers(); … … 229 230 protected function check_get_post_response( $response, $context = 'view' ) { 230 231 $this->assertNotInstanceOf( 'WP_Error', $response ); 231 232 $response = rest_ensure_response( $response ); 233 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 232 234 $this->assertEquals( 200, $response->get_status() ); 233 235 234 236 $data = $response->get_data(); … … 240 242 protected function check_create_post_response( $response ) { 241 243 $this->assertNotInstanceOf( 'WP_Error', $response ); 242 244 $response = rest_ensure_response( $response ); 245 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 243 246 244 247 $this->assertEquals( 201, $response->get_status() ); 245 248 $headers = $response->get_headers(); … … 253 256 protected function check_update_post_response( $response ) { 254 257 $this->assertNotInstanceOf( 'WP_Error', $response ); 255 258 $response = rest_ensure_response( $response ); 259 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 256 260 257 261 $this->assertEquals( 200, $response->get_status() ); 258 262 $headers = $response->get_headers(); -
tests/phpunit/tests/rest-api/rest-posts-controller.php
2837 2837 $request->set_param( 'force', 'false' ); 2838 2838 $response = $this->server->dispatch( $request ); 2839 2839 2840 $this->assertNotInstanceOf( 'WP_Error', $response );2840 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 2841 2841 $this->assertEquals( 200, $response->get_status() ); 2842 2842 $data = $response->get_data(); 2843 2843 $this->assertEquals( 'Deleted post', $data['title']['raw'] ); … … 2852 2852 $request['force'] = true; 2853 2853 $response = $this->server->dispatch( $request ); 2854 2854 2855 $this->assertNotInstanceOf( 'WP_Error', $response );2855 $this->assertNotInstanceOf( 'WP_Error', $response->as_error() ); 2856 2856 $this->assertEquals( 200, $response->get_status() ); 2857 2857 $data = $response->get_data(); 2858 2858 $this->assertTrue( $data['deleted'] );