- Timestamp:
- 07/13/2018 06:50:51 AM (6 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
r43442 r43445 1298 1298 1299 1299 $this->check_get_post_response( $response, 'edit' ); 1300 } 1301 1302 public function test_prepare_item_limit_fields() { 1303 wp_set_current_user( self::$editor_id ); 1304 $endpoint = new WP_REST_Posts_Controller( 'post' ); 1305 $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) ); 1306 $request->set_param( 'context', 'edit' ); 1307 $request->set_param( '_fields', 'id,slug' ); 1308 $obj = get_post( self::$post_id ); 1309 $response = $endpoint->prepare_item_for_response( $obj, $request ); 1310 $this->assertEquals( array( 1311 'id', 1312 'slug', 1313 ), array_keys( $response->get_data() ) ); 1300 1314 } 1301 1315
Note: See TracChangeset
for help on using the changeset viewer.