You are here

function LanguageHierarchyBaseTestCase::createPageNode in Language Hierarchy 7

Create a "Basic page" in the specified language.

Parameters

$title: Title of the basic page in the specified language.

$body: Body of the basic page in the specified language.

$langcode: The language code to be assigned to the specified values.

4 calls to LanguageHierarchyBaseTestCase::createPageNode()
EntityTranslationHierarchyViewsWebTestCase::testViewsSupport in modules/entity_translation_hierarchy/tests/entity_translation_hierarchy.test
Test support for inheritance in views.
EntityTranslationHierarchyWebTestCase::testBlockingOfTranslation in modules/entity_translation_hierarchy/tests/entity_translation_hierarchy.test
Test if translation blocking mechanism is working as expected when viewing node.
EntityTranslationHierarchyWebTestCase::testFieldTranslationInheritance in modules/entity_translation_hierarchy/tests/entity_translation_hierarchy.test
Test if translations are properly displayed when viewing node page.
XMLSitemapLanguageHierarchyStringTranslationWebTestCase::testSiteMapLanguageLinks in modules/xmlsitemap_language_hierarchy/tests/xmlsitemap_language_hierarchy.test

File

tests/language_hierarchy.test, line 224
Tests for Language Hierarchy module.

Class

LanguageHierarchyBaseTestCase
Base class for Language Hierarchy module tests.

Code

function createPageNode($title, $body, $langcode) {
  $edit = array();
  $edit["title"] = $title;

  // Language code on field of a new node is initially the current language.
  $edit["body[en][0][value]"] = $body;
  $edit['language'] = $langcode;
  $this
    ->drupalPost('node/add/page', $edit, t('Save'));
  $this
    ->assertRaw(t('Basic page %title has been created.', array(
    '%title' => $title,
  )), t('Basic page created.'));

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