function StorageTest::testValidation

Tests validation when form storage is used.

File

core/modules/system/tests/src/Functional/Form/StorageTest.php, line 102

Class

StorageTest
Tests a multistep form using form storage and makes sure validation and caching works right.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testValidation() {
  $this->drupalPostForm('form_test/form-storage', [
    'title' => '',
    'value' => 'value_is_set',
  ], 'Continue submit');
  // Ensure that the input values have been kept.
  $this->assertPattern('/value_is_set/');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.