function HTMLIdTest::testHTMLId

Tests that HTML IDs do not get duplicated when form validation fails.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Form/HTMLIdTest.php, line 35
Definition of Drupal\system\Tests\Form\HTMLIdTest.

Class

HTMLIdTest
Tests uniqueness of generated HTML IDs.

Namespace

Drupal\system\Tests\Form

Code

function testHTMLId() {
  $this
    ->drupalGet('form-test/double-form');
  $this
    ->assertNoDuplicateIds('There are no duplicate IDs');

  // Submit second form with empty title.
  $edit = array();
  $this
    ->drupalPost(NULL, $edit, 'Save', array(), array(), 'form-test-html-id--2');
  $this
    ->assertNoDuplicateIds('There are no duplicate IDs');
}