You are here

public function ElementTest::testFormElementErrors in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ElementTest.php \Drupal\Tests\system\Functional\Form\ElementTest::testFormElementErrors()
  2. 10 core/modules/system/tests/src/Functional/Form/ElementTest.php \Drupal\Tests\system\Functional\Form\ElementTest::testFormElementErrors()

Tests form element error messages.

File

core/modules/system/tests/src/Functional/Form/ElementTest.php, line 227

Class

ElementTest
Tests building and processing of core form elements.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testFormElementErrors() {
  $this
    ->drupalPostForm('form_test/details-form', [], 'Submit');
  $this
    ->assertText('I am an error on the details element.');
}