From e8eabb8583b32e1887e9e37f5626fe8b87e25c51 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Fri, 19 Oct 2018 11:56:20 +0000 Subject: [PATCH] REST API: Use a truly impossibly high number in User Controller tests. The `100` number could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason. Fixes #45128. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43767 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-users-controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 1a71bf6ae3..551fd83514 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -798,7 +798,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { public function test_get_user_invalid_id() { wp_set_current_user( self::$user ); - $request = new WP_REST_Request( 'GET', '/wp/v2/users/100' ); + $request = new WP_REST_Request( 'GET', '/wp/v2/users/' . REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ); $response = $this->server->dispatch( $request ); $this->assertErrorResponse( 'rest_user_invalid_id', $response, 404 ); @@ -2069,7 +2069,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { $this->allow_user_to_manage_multisite(); wp_set_current_user( self::$user ); - $request = new WP_REST_Request( 'DELETE', '/wp/v2/users/100' ); + $request = new WP_REST_Request( 'DELETE', '/wp/v2/users/' . REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ); $request['force'] = true; $request->set_param( 'reassign', false ); $response = $this->server->dispatch( $request ); @@ -2119,7 +2119,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/users/%d', $user_id ) ); $request['force'] = true; - $request->set_param( 'reassign', 100 ); + $request->set_param( 'reassign', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ); $response = $this->server->dispatch( $request ); // Not implemented in multisite.