WordPress.org

Make WordPress Core

Changeset 36050


Ignore:
Timestamp:
12/21/2015 07:15:33 AM (5 years ago)
Author:
johnbillion
Message:

Tests: Prevent role capability pollution in Tests_Post_GetPostsByAuthorSql::test_user_has_access_only_to_private_posts_for_certain_post_types().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/getPostsByAuthorSql.php

    r35242 r36050  
    137137
    138138        $maybe_string = get_posts_by_author_sql( array( 'foo', 'bar', 'baz' ) );
     139
     140        $editor_role->remove_cap( 'read_private_baz' );
     141
    139142        $this->assertNotContains( "post_type = 'foo' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
    140143        $this->assertNotContains( "post_type = 'bar' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
Note: See TracChangeset for help on using the changeset viewer.