Role/Capability: Introduce capability tests for non-logged-in users.

Fixes #37405


git-svn-id: https://develop.svn.wordpress.org/trunk@38096 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2016-07-18 22:38:18 +00:00
parent 4f2008a104
commit 4a39dde8f5
1 changed files with 12 additions and 0 deletions

View File

@ -1183,4 +1183,16 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
}
public function testNonLoggedInUsersHaveNoCapabilities() {
$this->assertFalse( is_user_logged_in() );
$caps = $this->getCapsAndRoles();
foreach ( $caps as $cap => $roles ) {
$this->assertFalse( current_user_can( $cap ), "Non-logged-in user should not have the {$cap} capability" );
}
}
}