You are here

function OgTestCase::addOgGroup in Organic groups 6.2

Same name and namespace in other branches
  1. 6 tests/og_testcase.php \OgTestCase::addOgGroup()

Create a group node.

Parameters

$type: The content type name.

$selective: The group's visibility (e.g. open, moderated, etc').

$args: Other node fields to be saved with the node object.

Return value

The newly created node id.

4 calls to OgTestCase::addOgGroup()
OgContext::setUp in tests/og.context.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
OgPost::testOgPost in tests/og.post.test
Test the simple case of creation of a group node and a group post by the same user.
OgSubscribe::setUp in tests/og.subscribe.test
Implementation of setUp().
OgWiki::testOgWiki in tests/og_wiki.test
Test the simple case of creation of a group node and a group post by the same user.

File

tests/og_testcase.php, line 21
Common functions for all the organic groups tests.

Class

OgTestCase
@file Common functions for all the organic groups tests.

Code

function addOgGroup($type, $selective = OG_OPEN, $args = array()) {
  $edit = array();
  $edit['og_description'] = $this
    ->randomName(16);
  $edit['og_selective'] = $selective;
  $edit = array_merge($edit, $args);

  // Keys that should be present when the node is loaded.
  $keys = array(
    'og_selective',
    'og_description',
    'og_theme',
    'og_register',
    'og_directory',
    'og_language',
    'og_private',
  );
  $keys = array_merge($keys, array_keys($args));
  $og_type = t('Group node');
  return $this
    ->_addOgContent($type, $og_type, $edit, $keys);
}