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

git-svn-id: https://develop.svn.wordpress.org/trunk@36050 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2015-12-21 07:15:33 +00:00
parent b637e77c5a
commit ec143694f7

View File

@ -136,6 +136,9 @@ class Tests_Post_GetPostsByAuthorSql extends WP_UnitTestCase {
wp_set_current_user( $u );
$maybe_string = get_posts_by_author_sql( array( 'foo', 'bar', 'baz' ) );
$editor_role->remove_cap( 'read_private_baz' );
$this->assertNotContains( "post_type = 'foo' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
$this->assertNotContains( "post_type = 'bar' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
$this->assertContains( "post_type = 'baz' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );