- Timestamp:
- 10/05/2017 12:36:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php
r40376 r41760 249 249 $this->assertEquals( 'Apple', $data[1]['name'] ); 250 250 $this->assertEquals( 'Cantaloupe', $data[2]['name'] ); 251 } 252 253 public function test_get_items_orderby_slugs() { 254 $this->factory->tag->create( array( 'name' => 'Burrito' ) ); 255 $this->factory->tag->create( array( 'name' => 'Taco' ) ); 256 $this->factory->tag->create( array( 'name' => 'Chalupa' ) ); 257 258 $request = new WP_REST_Request( 'GET', '/wp/v2/tags' ); 259 $request->set_param( 'orderby', 'include_slugs' ); 260 $request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) ); 261 $response = $this->server->dispatch( $request ); 262 $data = $response->get_data(); 263 $this->assertEquals( 200, $response->get_status() ); 264 $this->assertEquals( 'taco', $data[0]['slug'] ); 265 $this->assertEquals( 'burrito', $data[1]['slug'] ); 266 $this->assertEquals( 'chalupa', $data[2]['slug'] ); 251 267 } 252 268
Note: See TracChangeset
for help on using the changeset viewer.