You are here

function FormsFormStorageTestCase::testForm in SimpleTest 7

Tests using the form in a usual way.

File

tests/form.test, line 399
Unit tests for the Drupal Form API.

Class

FormsFormStorageTestCase
Test the form storage on a multistep form.

Code

function testForm() {
  $user = $this
    ->drupalCreateUser(array(
    'access content',
  ));
  $this
    ->drupalLogin($user);
  $this
    ->drupalPost('form_test/form-storage', array(
    'title' => 'new',
    'value' => 'value_is_set',
  ), 'Continue');
  $this
    ->assertText('Form constructions: 2', t('The form has been constructed two times till now.'));
  $this
    ->drupalPost(NULL, array(), 'Save');
  $this
    ->assertText('Form constructions: 3', t('The form has been constructed three times till now.'));
  $this
    ->assertText('Title: new', t('The form storage has stored the values.'));
}