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
This commit is contained in:
Ryan McCue 2017-07-06 01:34:40 +00:00
parent 3eb767b5c3
commit 8b5c4ae745
1 changed files with 1 additions and 1 deletions

View File

@ -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