- Timestamp:
- 11/03/2016 08:04:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r39105 r39126 726 726 $this->assertEquals( 200, $response->get_status() ); 727 727 $data = $response->get_data(); 728 $this->assertEquals( 'Deleted Category', $data['name'] ); 729 } 730 731 public function test_delete_item_force_false() { 728 $this->assertTrue( $data['deleted'] ); 729 $this->assertEquals( 'Deleted Category', $data['previous']['name'] ); 730 } 731 732 public function test_delete_item_no_trash() { 732 733 wp_set_current_user( self::$administrator ); 733 734 $term = get_term_by( 'id', $this->factory->category->create( array( 'name' => 'Deleted Category' ) ), 'category' ); 735 734 736 $request = new WP_REST_Request( 'DELETE', '/wp/v2/categories/' . $term->term_id ); 735 // force defaults to false 736 $response = $this->server->dispatch( $request ); 737 $this->assertEquals( 501, $response->get_status() ); 737 $response = $this->server->dispatch( $request ); 738 $this->assertErrorResponse( 'rest_trash_not_supported', $response, 501 ); 739 740 $request->set_param( 'force', 'false' ); 741 $response = $this->server->dispatch( $request ); 742 $this->assertErrorResponse( 'rest_trash_not_supported', $response, 501 ); 738 743 } 739 744
Note: See TracChangeset
for help on using the changeset viewer.