- Timestamp:
- 05/02/2018 01:24:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r42724 r43087 236 236 $this->assertEquals( 200, $response->get_status() ); 237 237 $this->check_get_revision_response( $response, $this->revision_1 ); 238 } 239 240 public function test_prepare_item_limit_fields() { 241 wp_set_current_user( self::$editor_id ); 242 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 ); 243 $endpoint = new WP_REST_Revisions_Controller( 'post' ); 244 $request->set_param( 'context', 'edit' ); 245 $request->set_param( '_fields', 'id,slug' ); 246 $revision = get_post( $this->revision_id1 ); 247 $response = $endpoint->prepare_item_for_response( $revision, $request ); 248 $this->assertEquals( array( 249 'id', 250 'slug', 251 ), array_keys( $response->get_data() ) ); 238 252 } 239 253
Note: See TracChangeset
for help on using the changeset viewer.