You are here

protected function OpenAtriumAccessBaseTestCase::oaCreateUser in Open Atrium Core 7.2

Create a user with an optional Space.

Replaces $this->drupalCreateUser() inside this test class.

Parameters

array $permissions: An array containing all the permissions this user should have.

object $space: (Optional) A Drupal node object representing the Space this user should be created in.

Return value

object The Drupal user object that was created.

See also

DrupalWebTestCase::drupalCreateUser()

11 calls to OpenAtriumAccessBaseTestCase::oaCreateUser()
OpenAtriumAccessAllTestCase::testAddSpaces in modules/oa_access/tests/oa_access.test
OpenAtriumAccessAllTestCase::testModuleEnableWithTeams in modules/oa_access/tests/oa_access.test
OpenAtriumAccessBaseTestCase::oaCreateGroupWithUser in modules/oa_access/tests/oa_access.test
Creates an Open Atrium Group with a new user in an optional Space.
OpenAtriumAccessBaseTestCase::oaCreateTeamWithUser in modules/oa_access/tests/oa_access.test
Creates an Open Atrium Team with a new user in a Space.
OpenAtriumAccessTestCase::testGroupAccess in modules/oa_access/tests/oa_access.test

... See full list

File

modules/oa_access/tests/oa_access.test, line 91
Functional tests for the Open Atrium Access module.

Class

OpenAtriumAccessBaseTestCase

Code

protected function oaCreateUser($permissions, $space = NULL) {
  $account = $this
    ->drupalCreateUser($permissions);
  if ($space) {
    og_group('node', $space->nid, array(
      'entity type' => 'user',
      'entity' => $account,
      'membership type' => OG_MEMBERSHIP_TYPE_DEFAULT,
    ));
  }
  return $account;
}