From 0ca5139e7086a34de0c8aa453ad29b614ba33a4d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 17 Dec 2018 01:41:10 +0000 Subject: [PATCH] Tests: Replace use of `$this->server` with `rest_get_server()` in `test_get_additional_field_registration_null_schema()`. In [42724], `$this->server` was replaced with `rest_get_server()` for better memory recycling. [43908], from the 5.0 branch, was merged into trunk in [44254] and used the now unavailable `$this->server`. This updates the new test from the 5.0 branch to use the expected `rest_get_server()`. See #45220, #41641. git-svn-id: https://develop.svn.wordpress.org/trunk@44256 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-posts-controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index 448501d56d..d683924a8a 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -3778,19 +3778,19 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te // 'my_custom_int' should appear because ?_fields= isn't set. $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); - $response = $this->server->dispatch( $request ); + $response = rest_get_server()->dispatch( $request ); $this->assertArrayHasKey( 'my_custom_int', $response->data ); // 'my_custom_int' should appear because it's present in ?_fields=. $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); $request->set_param( '_fields', 'title,my_custom_int' ); - $response = $this->server->dispatch( $request ); + $response = rest_get_server()->dispatch( $request ); $this->assertArrayHasKey( 'my_custom_int', $response->data ); // 'my_custom_int' should not appear because it's not present in ?_fields=. $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id ); $request->set_param( '_fields', 'title' ); - $response = $this->server->dispatch( $request ); + $response = rest_get_server()->dispatch( $request ); $this->assertArrayNotHasKey( 'my_custom_int', $response->data ); global $wp_rest_additional_fields;