You are here

protected function UserProtectWebTestBase::createProtectedUser in User protect 7

Creates a protected user.

Parameters

array $protections: (optional) The active protections. Defaults to an empty array.

Return value

object The created user.

11 calls to UserProtectWebTestBase::createProtectedUser()
UserProtectPermissionsWebTest::_testTemp in tests/UserProtectPermissionsWebTest.test
Temporary test function.
UserProtectProtectionWebTest::testMailProtection in tests/UserProtectProtectionWebTest.test
Tests if the user's mail address field has the expected protection.
UserProtectProtectionWebTest::testNameProtection in tests/UserProtectProtectionWebTest.test
Tests if the user's name field has the expected protection.
UserProtectProtectionWebTest::testPassProtection in tests/UserProtectProtectionWebTest.test
Tests if the user's password field has the expected protection.
UserProtectProtectionWebTest::testRolesProtection in tests/UserProtectProtectionWebTest.test
Tests if the user's roles field has the expected protection.

... See full list

File

tests/UserProtectWebTestBase.test, line 54
Contains \UserProtectWebTestBase.

Class

UserProtectWebTestBase
Base class for User protect web tests.

Code

protected function createProtectedUser(array $protections = array()) {

  // Create a user.
  $account = $this
    ->drupalCreateUser();

  // Protect this user.
  $this
    ->createProtectionRule($account->uid, $protections, 'user');
  return $account;
}