You are here

protected function OpenAtriumAccessBaseTestCase::oaCreateNode in Open Atrium Core 7.2

Creates a node with an optional Space or Section.

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

Parameters

array $info: An associative array with information about the node which will eventually get passed to node_save().

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

object $section: (Optional) A Drupal node object representing the Section this node should be created in.

Return value

object The Drupal node object that was created.

See also

DrupalWebTestCase::drupalCreateNode()

8 calls to OpenAtriumAccessBaseTestCase::oaCreateNode()
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::testTeamAccess in modules/oa_access/tests/oa_access.test

... See full list

File

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

Class

OpenAtriumAccessBaseTestCase

Code

protected function oaCreateNode($info, $space = NULL, $section = NULL) {
  if ($space) {
    $info['og_group_ref'][LANGUAGE_NONE][0]['target_id'] = $space->nid;
  }
  if ($section) {
    $info['oa_section_ref'][LANGUAGE_NONE][0]['target_id'] = $section->nid;
  }
  return $this
    ->drupalCreateNode($info);
}