- 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-tags-controller.php
r42724 r43087 969 969 } 970 970 971 public function test_prepare_item_limit_fields() { 972 $request = new WP_REST_Request; 973 $endpoint = new WP_REST_Terms_Controller( 'post_tag' ); 974 $request->set_param( '_fields', 'id,name' ); 975 $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' ); 976 $response = $endpoint->prepare_item_for_response( $term, $request ); 977 $this->assertEquals( array( 978 'id', 979 'name', 980 ), array_keys( $response->get_data() ) ); 981 } 982 971 983 public function test_get_item_schema() { 972 984 $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/tags' );
Note: See TracChangeset
for help on using the changeset viewer.