- 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-comments-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-comments-controller.php
r40101 r43445 794 794 $data = $response->get_data(); 795 795 $this->check_comment_data( $data, 'edit', $response->get_links() ); 796 } 797 798 public function test_prepare_item_limit_fields() { 799 wp_set_current_user( self::$admin_id ); 800 $endpoint = new WP_REST_Comments_Controller; 801 $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%d', self::$approved_id ) ); 802 $request->set_param( 'context', 'edit' ); 803 $request->set_param( '_fields', 'id,status' ); 804 $obj = get_comment( self::$approved_id ); 805 $response = $endpoint->prepare_item_for_response( $obj, $request ); 806 $this->assertEquals( array( 807 'id', 808 'status', 809 ), array_keys( $response->get_data() ) ); 796 810 } 797 811
Note: See TracChangeset
for help on using the changeset viewer.