- Timestamp:
- 07/13/2018 06:50:51 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-categories-controller.php
r43443 r43445 828 828 } 829 829 830 public function test_prepare_item_limit_fields() { 831 $request = new WP_REST_Request; 832 $endpoint = new WP_REST_Terms_Controller( 'category' ); 833 $request->set_param( '_fields', 'id,name' ); 834 $term = get_term( 1, 'category' ); 835 $response = $endpoint->prepare_item_for_response( $term, $request ); 836 $this->assertEquals( array( 837 'id', 838 'name', 839 ), array_keys( $response->get_data() ) ); 840 } 841 830 842 public function test_prepare_taxonomy_term_child() { 831 843 $child = $this->factory->category->create( array(
Note: See TracChangeset
for help on using the changeset viewer.