You are here

function TranslationModuleTestCase::create_story in SimpleTest 6

Create a story in the specified language.

Parameters

string $title Title of story in specified language.:

string $body Body of story in specified language.:

string $language Langauge code.:

1 call to TranslationModuleTestCase::create_story()
TranslationModuleTestCase::test_content_translation in tests/translation_module.test

File

tests/translation_module.test, line 106

Class

TranslationModuleTestCase

Code

function create_story($title, $body, $language) {
  $this
    ->drupalVariableSet('node_options_page', array(
    'status',
    'promote',
  ));
  $edit = array();
  $edit['title'] = $title;
  $edit['body'] = $body;
  $edit['language'] = $language;
  $this
    ->drupalPost('node/add/story', $edit, 'Save');
  $this
    ->assertWantedRaw(t('Story %title has been created.', array(
    '%title' => $edit['title'],
  )), 'Story created.');

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