- Timestamp:
- 10/04/2017 04:23:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r39896 r41737 603 603 } 604 604 605 /** 606 * @ticket 41370 607 */ 608 public function test_create_item_term_already_exists() { 609 wp_set_current_user( self::$administrator ); 610 $request = new WP_REST_Request( 'POST', '/wp/v2/categories' ); 611 $request->set_param( 'name', 'test' ); 612 $response = $this->server->dispatch( $request ); 613 $this->assertEquals( 201, $response->get_status() ); 614 $response = $this->server->dispatch( $request ); 615 $this->assertEquals( 409, $response->get_status() ); 616 $data = $response->get_data(); 617 $this->assertEquals( 'term_exists', $data['code'] ); 618 } 619 605 620 public function test_create_item_invalid_taxonomy() { 606 621 wp_set_current_user( self::$administrator );
Note: See TracChangeset
for help on using the changeset viewer.