From 8b5c4ae745ed13194e5c3bac66b19c28b4d2315e Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Thu, 6 Jul 2017 01:34:40 +0000 Subject: [PATCH] REST API: Fix brittle search test. This was previously searching for the user ID, which isn't really what it was meant to do. As a result, the test can break if that number appears in any other user information. git-svn-id: https://develop.svn.wordpress.org/trunk@41011 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-users-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 44853aa13a..30246932bf 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -546,7 +546,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { $this->assertEquals( 0, count( $response->get_data() ) ); $yolo_id = $this->factory->user->create( array( 'display_name' => 'yololololo' ) ); $request = new WP_REST_Request( 'GET', '/wp/v2/users' ); - $request->set_param( 'search', (string) $yolo_id ); + $request->set_param( 'search', 'yololololo' ); $response = $this->server->dispatch( $request ); $this->assertEquals( 1, count( $response->get_data() ) ); // default to wildcard search