You are here

function WebformGeneralTestCase::testWebformCreate in Webform 6.3

Same name and namespace in other branches
  1. 7.4 tests/WebformGeneralTestCase.test \WebformGeneralTestCase::testWebformCreate()
  2. 7.3 tests/webform.test \WebformGeneralTestCase::testWebformCreate()

Test creating a new Webform node.

File

tests/webform.test, line 743
Webform module tests.

Class

WebformGeneralTestCase
Test general functionality of Webform.

Code

function testWebformCreate() {
  $settings = array(
    'title' => 'Test webform, no components',
    'type' => 'webform',
  );
  $node = $this
    ->drupalCreateNode($settings);

  // Because this is a "webform" type node, it should have an entry in the
  // database even though it's using the default settings.
  $this
    ->assertTrue($this
    ->webformRecordExists($node->nid), t('Webform record made in the database for the new webform node.'));

  // Make a change to the node, ensure that the record stays intact.
  $node->title .= '!';
  node_save($node);
  $this
    ->assertTrue($this
    ->webformRecordExists($node->nid), t('Webform record still in the database after modifying webform node.'));
}