mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -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" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user