You are here

protected function FeedsOgTest::createGroup in Feeds 7.2

Creates a group node.

Parameters

string $name: Name of the group.

int $owner_uid: User ID of the owner of the group.

Return value

object The created group node.

2 calls to FeedsOgTest::createGroup()
FeedsOgTest::setUpStuffForTestingOgReferenceWithoutAuthorizing in tests/feeds_og.test
Sets up stuff for testing with the authorize option turned off.
FeedsOgTest::testImportOgReferenceWithAuthorizing in tests/feeds_og.test
Tests authorizing users importing content for a group.

File

tests/feeds_og.test, line 74
Contains FeedsOgTest.

Class

FeedsOgTest
Tests for Organic Groups integration.

Code

protected function createGroup($name, $owner_uid) {
  $group = entity_create('node', array(
    'type' => 'page',
    'title' => $name,
    'uid' => $owner_uid,
  ));
  $wrapper = entity_metadata_wrapper('node', $group);
  $wrapper->{OG_GROUP_FIELD}
    ->set(1);
  $wrapper
    ->save();
  return $group;
}