You are here

protected function RequiredByRoleBasic::getRequiredUser in Required by role 7.2

Same name and namespace in other branches
  1. 7 tests/required_by_role_test/RequiredByRoleBasic.test \RequiredByRoleBasic::getRequiredUser()

Helper method to ghet a required user.

1 call to RequiredByRoleBasic::getRequiredUser()
RequiredByRoleCommonWebTestCase::setUp in tests/required_by_role_test/RequiredByRoleCommonWebTestCase.test
Setup method.

File

tests/required_by_role_test/RequiredByRoleBasic.test, line 62
Tests for Required by role module.

Class

RequiredByRoleBasic
Base class for all required by role web test cases.

Code

protected function getRequiredUser() {
  $account = self::$required_user;
  if (is_null($account)) {
    $account = $this
      ->drupalCreateUser($this->basePermissions);
    $edit = array();
    $edit['roles'] = array(
      $this->required_fields_rid => $this->required_fields_rid,
    );
    $account = user_save($account, $edit);
    self::$required_user = $account;
  }
  return $account;
}