- Timestamp:
- 10/05/2017 12:36:43 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r41226 r41760 408 408 $data = $response->get_data(); 409 409 $this->assertEquals( $low_id, $data[0]['id'] ); 410 } 411 412 public function test_get_items_orderby_slugs() { 413 wp_set_current_user( self::$user ); 414 415 $this->factory->user->create( array( 'user_nicename' => 'burrito' ) ); 416 $this->factory->user->create( array( 'user_nicename' => 'taco' ) ); 417 $this->factory->user->create( array( 'user_nicename' => 'chalupa' ) ); 418 419 $request = new WP_REST_Request( 'GET', '/wp/v2/users' ); 420 $request->set_param( 'orderby', 'include_slugs' ); 421 $request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) ); 422 $response = $this->server->dispatch( $request ); 423 $data = $response->get_data(); 424 425 $this->assertEquals( 'taco', $data[0]['slug'] ); 426 $this->assertEquals( 'burrito', $data[1]['slug'] ); 427 $this->assertEquals( 'chalupa', $data[2]['slug'] ); 410 428 } 411 429
Note: See TracChangeset
for help on using the changeset viewer.