- Timestamp:
- 07/13/2018 06:50:51 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/rest-api/rest-post-statuses-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php
r41176 r43445 128 128 $data = $endpoint->prepare_item_for_response( $obj, $request ); 129 129 $this->check_post_status_obj( $obj, $data->get_data(), $data->get_links() ); 130 } 131 132 public function test_prepare_item_limit_fields() { 133 $obj = get_post_status_object( 'publish' ); 134 $request = new WP_REST_Request; 135 $endpoint = new WP_REST_Post_Statuses_Controller; 136 $request->set_param( 'context', 'edit' ); 137 $request->set_param( '_fields', 'id,name' ); 138 $response = $endpoint->prepare_item_for_response( $obj, $request ); 139 $this->assertEquals( array( 140 // 'id' doesn't exist in this context. 141 'name', 142 ), array_keys( $response->get_data() ) ); 130 143 } 131 144
Note: See TracChangeset
for help on using the changeset viewer.