- Timestamp:
- 11/03/2016 08:04:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r38975 r39126 185 185 wp_set_current_user( self::$editor_id ); 186 186 $request = new WP_REST_Request( 'DELETE', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 ); 187 $request->set_param( 'force', true ); 187 188 $response = $this->server->dispatch( $request ); 188 189 $this->assertEquals( 200, $response->get_status() ); 189 190 $this->assertNull( get_post( $this->revision_id1 ) ); 191 } 192 193 public function test_delete_item_no_trash() { 194 wp_set_current_user( self::$editor_id ); 195 196 $request = new WP_REST_Request( 'DELETE', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 ); 197 $response = $this->server->dispatch( $request ); 198 $this->assertErrorResponse( 'rest_trash_not_supported', $response, 501 ); 199 200 $request->set_param( 'force', 'false' ); 201 $response = $this->server->dispatch( $request ); 202 $this->assertErrorResponse( 'rest_trash_not_supported', $response, 501 ); 203 204 // Ensure the revision still exists 205 $this->assertNotNull( get_post( $this->revision_id1 ) ); 190 206 } 191 207
Note: See TracChangeset
for help on using the changeset viewer.