- Timestamp:
- 01/06/2018 07:28:44 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r40306 r42427 469 469 } 470 470 471 public function test_get_item_private_post () {471 public function test_get_item_private_post_not_authenticated() { 472 472 wp_set_current_user( 0 ); 473 473 $draft_post = $this->factory->post->create( array( 'post_status' => 'draft' ) ); … … 478 478 $request = new WP_REST_Request( 'GET', '/wp/v2/media/' . $id1 ); 479 479 $response = $this->server->dispatch( $request ); 480 $this->assertEquals( 40 3, $response->get_status() );480 $this->assertEquals( 401, $response->get_status() ); 481 481 } 482 482 … … 494 494 } 495 495 496 public function test_get_item_auto_status_with_invalid_parent_ returns_error() {496 public function test_get_item_auto_status_with_invalid_parent_not_authenticated_returns_error() { 497 497 $attachment_id = $this->factory->attachment->create_object( $this->test_file, REST_TESTS_IMPOSSIBLY_HIGH_NUMBER, array( 498 498 'post_mime_type' => 'image/jpeg', … … 503 503 $response = $this->server->dispatch( $request ); 504 504 505 $this->assertErrorResponse( 'rest_forbidden', $response, 40 3);505 $this->assertErrorResponse( 'rest_forbidden', $response, 401 ); 506 506 } 507 507
Note: See TracChangeset
for help on using the changeset viewer.