protected function UserProtectWebTestBase::createProtectedRole in User protect 7
Creates a protected role.
Parameters
array $protections: (optional) The active protections. Defaults to an empty array.
Return value
string The ID of the created role.
2 calls to UserProtectWebTestBase::createProtectedRole()
- UserProtectPermissionsWebTest::_testTemp in tests/
UserProtectPermissionsWebTest.test - Temporary test function.
- UserProtectWebTestBase::createUserWithProtectedRole in tests/
UserProtectWebTestBase.test - Creates an user with a protected role.
File
- tests/
UserProtectWebTestBase.test, line 34 - Contains \UserProtectWebTestBase.
Class
- UserProtectWebTestBase
- Base class for User protect web tests.
Code
protected function createProtectedRole(array $protections = array()) {
// Create a role.
$rid = $this
->drupalCreateRole(array());
// Protect this role.
$this
->createProtectionRule($rid, $protections);
return $rid;
}