- 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-users-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-users-controller.php
r43067 r43445 762 762 $data = $this->endpoint->prepare_item_for_response( $user, $request ); 763 763 $this->check_get_user_response( $data, 'edit' ); 764 } 765 766 public function test_prepare_item_limit_fields() { 767 wp_set_current_user( self::$user ); 768 $request = new WP_REST_Request; 769 $request->set_param( 'context', 'edit' ); 770 $request->set_param( '_fields', 'id,name' ); 771 $user = get_user_by( 'id', get_current_user_id() ); 772 $response = $this->endpoint->prepare_item_for_response( $user, $request ); 773 $this->assertEquals( array( 774 'id', 775 'name', 776 ), array_keys( $response->get_data() ) ); 764 777 } 765 778
Note: See TracChangeset
for help on using the changeset viewer.