Make WordPress Core


Ignore:
Timestamp:
07/06/2017 01:34:40 AM (7 years ago)
Author:
rmccue
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r40564 r41011  
    547547        $yolo_id = $this->factory->user->create( array( 'display_name' => 'yololololo' ) );
    548548        $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
    549         $request->set_param( 'search', (string) $yolo_id );
     549        $request->set_param( 'search', 'yololololo' );
    550550        $response = $this->server->dispatch( $request );
    551551        $this->assertEquals( 1, count( $response->get_data() ) );
Note: See TracChangeset for help on using the changeset viewer.