Skip to content

Instantly share code, notes, and snippets.

@rachelbaker
Created June 2, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rachelbaker/7246459a9b3a01c8bdeb to your computer and use it in GitHub Desktop.
Save rachelbaker/7246459a9b3a01c8bdeb to your computer and use it in GitHub Desktop.
function test_get_revisions_without_permission() {
$this->markTestSkipped( 'https://github.com/WP-API/WP-API/issues/251' );
$user = wp_get_current_user();
$user->add_cap( 'publish_posts', false );
// Flush capabilities, https://core.trac.wordpress.org/ticket/28374
$user->get_role_caps();
$user->update_user_level_from_caps();
$response = $this->endpoint->get_revisions( $this->post_id );
$this->assertErrorResponse( 'json_cannot_view', $response, 403 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment