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:
parent
4f2008a104
commit
4a39dde8f5
@ -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" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user