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:
parent
3eb767b5c3
commit
8b5c4ae745
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user