You are here

function EntityTranslationUpgradeTestCase::createContentTranslationPage in Entity Translation 7

See also

TranslationTestCase::createPage

1 call to EntityTranslationUpgradeTestCase::createContentTranslationPage()
EntityTranslationUpgradeTestCase::testUpgradeContentToEntityTranslation in entity_translation_upgrade/entity_translation_upgrade.test
Tests copying of source node's body value in the add translation form page.

File

entity_translation_upgrade/entity_translation_upgrade.test, line 68
Tests for Entity Translation module.

Class

EntityTranslationUpgradeTestCase
Tests for the upgrade translation process.

Code

function createContentTranslationPage($title, $body, $language = NULL) {
  $edit = array();
  $langcode = LANGUAGE_NONE;
  $edit["title"] = $title;
  $edit["body[{$langcode}][0][value]"] = $body;
  if (!empty($language)) {
    $edit['language'] = $language;
  }
  $this
    ->drupalPost('node/add/page', $edit, t('Save'));
  $this
    ->assertRaw(t('Basic page %title has been created.', array(
    '%title' => $title,
  )), 'Basic page created.');

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