- Timestamp:
- 12/17/2018 01:41:10 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r44254 r44256 3779 3779 // 'my_custom_int' should appear because ?_fields= isn't set. 3780 3780 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); 3781 $response = $this->server->dispatch( $request );3781 $response = rest_get_server()->dispatch( $request ); 3782 3782 $this->assertArrayHasKey( 'my_custom_int', $response->data ); 3783 3783 … … 3785 3785 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); 3786 3786 $request->set_param( '_fields', 'title,my_custom_int' ); 3787 $response = $this->server->dispatch( $request );3787 $response = rest_get_server()->dispatch( $request ); 3788 3788 $this->assertArrayHasKey( 'my_custom_int', $response->data ); 3789 3789 … … 3791 3791 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); 3792 3792 $request->set_param( '_fields', 'title' ); 3793 $response = $this->server->dispatch( $request );3793 $response = rest_get_server()->dispatch( $request ); 3794 3794 $this->assertArrayNotHasKey( 'my_custom_int', $response->data ); 3795 3795
Note: See TracChangeset
for help on using the changeset viewer.