- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r46586 r47122 107 107 108 108 public function test_context_param() { 109 // Collection 109 // Collection. 110 110 $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 111 111 $response = rest_get_server()->dispatch( $request ); … … 113 113 $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] ); 114 114 $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); 115 // Single 115 // Single. 116 116 $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_1->ID ); 117 117 $response = rest_get_server()->dispatch( $request ); … … 129 129 $this->assertCount( $this->total_revisions, $data ); 130 130 131 // Reverse chron 131 // Reverse chronology. 132 132 $this->assertEquals( $this->revision_id3, $data[0]['id'] ); 133 133 $this->check_get_revision_response( $data[0], $this->revision_3 ); … … 282 282 $this->assertErrorResponse( 'rest_trash_not_supported', $response, 501 ); 283 283 284 // Ensure the revision still exists 284 // Ensure the revision still exists. 285 285 $this->assertNotNull( get_post( $this->revision_id1 ) ); 286 286 }
Note: See TracChangeset
for help on using the changeset viewer.