- Timestamp:
- 10/26/2016 09:36:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php
r38832 r38968 60 60 'context', 61 61 'exclude', 62 'filter',63 62 'include', 64 63 'menu_order', … … 180 179 $draft_id = $this->factory->post->create( array( 'post_status' => 'draft', 'post_type' => 'page' ) ); 181 180 $request = new WP_REST_Request( 'GET', '/wp/v2/pages' ); 182 $request->set_param( 'filter', array( 'post_status' => 'draft' ) ); 183 $response = $this->server->dispatch( $request ); 184 $data = $response->get_data(); 185 $this->assertCount( 1, $data ); 186 $this->assertEquals( $page_id, $data[0]['id'] ); 181 $request->set_param( 'status', 'draft' ); 182 $response = $this->server->dispatch( $request ); 183 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 184 187 185 // But they are accessible to authorized users 188 186 wp_set_current_user( $this->editor_id );
Note: See TracChangeset
for help on using the changeset viewer.