- Timestamp:
- 01/01/2018 02:30:39 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r42343 r42423 525 525 } 526 526 527 public function test_get_item_private_post () {527 public function test_get_item_private_post_not_authenticated() { 528 528 wp_set_current_user( 0 ); 529 529 $draft_post = $this->factory->post->create( array( 'post_status' => 'draft' ) ); … … 536 536 $request = new WP_REST_Request( 'GET', '/wp/v2/media/' . $id1 ); 537 537 $response = $this->server->dispatch( $request ); 538 $this->assertEquals( 40 3, $response->get_status() );538 $this->assertEquals( 401, $response->get_status() ); 539 539 } 540 540 … … 554 554 } 555 555 556 public function test_get_item_auto_status_with_invalid_parent_ returns_error() {556 public function test_get_item_auto_status_with_invalid_parent_not_authenticated_returns_error() { 557 557 $attachment_id = $this->factory->attachment->create_object( 558 558 $this->test_file, REST_TESTS_IMPOSSIBLY_HIGH_NUMBER, array( … … 565 565 $response = $this->server->dispatch( $request ); 566 566 567 $this->assertErrorResponse( 'rest_forbidden', $response, 40 3);567 $this->assertErrorResponse( 'rest_forbidden', $response, 401 ); 568 568 } 569 569
Note: See TracChangeset
for help on using the changeset viewer.