- Timestamp:
- 07/13/2018 06:50:51 AM (8 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/rest-api/rest-revisions-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r41219 r43445 224 224 } 225 225 226 public function test_prepare_item_limit_fields() { 227 wp_set_current_user( self::$editor_id ); 228 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 ); 229 $endpoint = new WP_REST_Revisions_Controller( 'post' ); 230 $request->set_param( 'context', 'edit' ); 231 $request->set_param( '_fields', 'id,slug' ); 232 $revision = get_post( $this->revision_id1 ); 233 $response = $endpoint->prepare_item_for_response( $revision, $request ); 234 $this->assertEquals( array( 235 'id', 236 'slug', 237 ), array_keys( $response->get_data() ) ); 238 } 239 226 240 public function test_get_item_schema() { 227 241 $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions' );
Note: See TracChangeset
for help on using the changeset viewer.