- 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-categories-controller.php
r41737 r41760 288 288 } 289 289 290 public function test_get_items_orderby_slugs() { 291 $this->factory->category->create( array( 'name' => 'Burrito' ) ); 292 $this->factory->category->create( array( 'name' => 'Taco' ) ); 293 $this->factory->category->create( array( 'name' => 'Chalupa' ) ); 294 295 $request = new WP_REST_Request( 'GET', '/wp/v2/categories' ); 296 $request->set_param( 'orderby', 'include_slugs' ); 297 $request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) ); 298 $response = $this->server->dispatch( $request ); 299 $data = $response->get_data(); 300 $this->assertEquals( 200, $response->get_status() ); 301 $this->assertEquals( 'taco', $data[0]['slug'] ); 302 $this->assertEquals( 'burrito', $data[1]['slug'] ); 303 $this->assertEquals( 'chalupa', $data[2]['slug'] ); 304 } 305 290 306 protected function post_with_categories() { 291 307 $post_id = $this->factory->post->create();
Note: See TracChangeset
for help on using the changeset viewer.