You are here

public function SimpleTestExampleTestCase::testSimpleTestExampleCreate in Examples for Developers 6

Same name and namespace in other branches
  1. 7 simpletest_example/simpletest_example.test \SimpleTestExampleTestCase::testSimpleTestExampleCreate()

Create a simpletest_example node using the node form.

File

simpletest_example/simpletest_example.test, line 45
An example of SimpleTest tests to accompany the tutorial at http://drupal.org/node/395012.

Class

SimpleTestExampleTestCase
Tests the SimpleTest Example module's content type.

Code

public function testSimpleTestExampleCreate() {

  // Create node to edit.
  $edit = array();
  $edit['title'] = $this
    ->randomName(8);
  $edit['body'] = $this
    ->randomName(16);
  $this
    ->drupalPost('node/add/simpletest-example', $edit, t('Save'));
  $this
    ->assertText(t('simpletest_example page @title has been created.', array(
    '@title' => $edit['title'],
  )));
}