- 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-taxonomies-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
r43443 r43445 178 178 $response = $endpoint->prepare_item_for_response( $tax, $request ); 179 179 $this->check_taxonomy_object( 'edit', $tax, $response->get_data(), $response->get_links() ); 180 } 181 182 public function test_prepare_item_limit_fields() { 183 $tax = get_taxonomy( 'category' ); 184 $request = new WP_REST_Request; 185 $endpoint = new WP_REST_Taxonomies_Controller; 186 $request->set_param( 'context', 'edit' ); 187 $request->set_param( '_fields', 'id,name' ); 188 $response = $endpoint->prepare_item_for_response( $tax, $request ); 189 $this->assertEquals( array( 190 // 'id' doesn't exist in this context. 191 'name', 192 ), array_keys( $response->get_data() ) ); 180 193 } 181 194
Note: See TracChangeset
for help on using the changeset viewer.