- Timestamp:
- 05/02/2018 01:24:30 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r42724 r43087 881 881 882 882 $this->check_taxonomy_term( $term, $data, $response->get_links() ); 883 } 884 885 public function test_prepare_item_limit_fields() { 886 $request = new WP_REST_Request; 887 $endpoint = new WP_REST_Terms_Controller( 'category' ); 888 $request->set_param( '_fields', 'id,name' ); 889 $term = get_term( 1, 'category' ); 890 $response = $endpoint->prepare_item_for_response( $term, $request ); 891 $this->assertEquals( array( 892 'id', 893 'name', 894 ), array_keys( $response->get_data() ) ); 883 895 } 884 896
Note: See TracChangeset
for help on using the changeset viewer.