You are here

function OgTranslationTestCase::createPage in Organic groups 7

Create a "Basic page" in the specified language, and set it to be a group.

Parameters

$title: Title of basic page in specified language.

$body: Body of basic page in specified language.

$language: Language code.

group: TRUE to set node as group. FALSE by default.

1 call to OgTranslationTestCase::createPage()
OgTranslationTestCase::testOgNodeLocale in ./og.test
Test disabling OG fields on translated content.

File

./og.test, line 993

Class

OgTranslationTestCase
Test the multilangual groups.

Code

function createPage($title, $body, $language) {
  $edit = array();
  $property = OG_GROUP_FIELD;
  $langcode = LANGUAGE_NONE;
  $edit["title"] = $title;
  $edit["body[{$langcode}][0][value]"] = $body;
  $edit['language'] = $language;
  $this
    ->drupalPost('node/add/page', $edit, t('Save'));

  // Check to make sure the node was created.
  $node = $this
    ->drupalGetNodeByTitle($title);
  $this
    ->assertTrue($node, t('Node found in database.'));
  return $node;
}