protected function OpenAtriumAccessBaseTestCase::oaCreateTeamWithUser in Open Atrium Core 7.2
Creates an Open Atrium Team with a new user in a Space.
Parameters
array $info: An associative array with information about the node which will eventually get passed to node_save().
array $permissions: An array containing all the permissions this user should have.
object $space: A Drupal node object representing the Space this Team and user should be created in.
Return value
array An associative array with two keys:
- group: (object) A Drupal node object representing the new Group node.
- user: (object) A Drupal user object representing the new user.
4 calls to OpenAtriumAccessBaseTestCase::oaCreateTeamWithUser()
- OpenAtriumAccessTestCase::testTeamAccess in modules/
oa_access/ tests/ oa_access.test - OpenAtriumAccessTestCase::testTeamAdminPage in modules/
oa_access/ tests/ oa_access.test - OpenAtriumAccessTestCase::testTeamOverride in modules/
oa_access/ tests/ oa_access.test - OpenAtriumAccessTestCase::testUserTeams in modules/
oa_access/ tests/ oa_access.test
File
- modules/
oa_access/ tests/ oa_access.test, line 160 - Functional tests for the Open Atrium Access module.
Class
Code
protected function oaCreateTeamWithUser(array $info, array $permissions, $space) {
$info += array(
'type' => 'oa_team',
'title' => 'Team',
);
$team = $this
->oaCreateNode($info, $space);
$account = $this
->oaCreateUser($permissions, $space);
// Add the user to the team.
oa_teams_add_member($team, $account->uid);
return array(
'team' => $team,
'user' => $account,
);
}