1.20.x form.test | HTMLIdTestCase::testHTMLId() |
Tests that HTML IDs do not get duplicated when form validation fails.
File
- modules/
simpletest/ tests/ form.test, line 2232 - Unit tests for the Backdrop Form API.
Class
- HTMLIdTestCase
- Tests uniqueness of generated HTML IDs.
Code
function testHTMLId() {
$this->backdropGet('form-test/double-form');
$this->assertNoDuplicateIds('There are no duplicate IDs');
// Submit second form with empty title.
$edit = array();
$this->backdropPost(NULL, $edit, 'Save', array(), array(), 'form-test-html-id--2');
$this->assertNoDuplicateIds('There are no duplicate IDs');
}