- 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-posts-controller.php
r42056 r42427 1130 1130 } 1131 1131 1132 public function test_get_post_ without_permission() {1132 public function test_get_post_draft_status_not_authenicated() { 1133 1133 $draft_id = $this->factory->post->create( array( 1134 1134 'post_status' => 'draft', … … 1139 1139 $response = $this->server->dispatch( $request ); 1140 1140 1141 $this->assertErrorResponse( 'rest_forbidden', $response, 40 3);1141 $this->assertErrorResponse( 'rest_forbidden', $response, 401 ); 1142 1142 } 1143 1143 … … 1251 1251 } 1252 1252 1253 public function test_get_item_read_permission_custom_post_status () {1253 public function test_get_item_read_permission_custom_post_status_not_authenticated() { 1254 1254 register_post_status( 'testpubstatus', array( 'public' => true ) ); 1255 1255 register_post_status( 'testprivtatus', array( 'public' => false ) ); … … 1263 1263 $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) ); 1264 1264 $response = $this->server->dispatch( $request ); 1265 $this->assertEquals( 40 3, $response->get_status() );1265 $this->assertEquals( 401, $response->get_status() ); 1266 1266 } 1267 1267
Note: See TracChangeset
for help on using the changeset viewer.