1 form.test FormValidationTestCase::testMultiFormSameNameErrorClass()

Tests error border of multiple fields with same name in a page.

File

core/modules/simpletest/tests/form.test, line 861
Unit tests for the Backdrop Form API.

Class

FormValidationTestCase
Test form validation handlers.

Code

function testMultiFormSameNameErrorClass() {
  $this->backdropGet('form-test/double-form');
  $edit = array();
  $this->backdropPost(NULL, $edit, t('Save'));
  $this->assertFieldByXpath('//input[@id="edit-name" and contains(@class, "error")]', NULL, 'Error input form element class found for first element.');
  $this->assertNoFieldByXpath('//input[@id="edit-name--2" and contains(@class, "error")]', NULL, 'No error input form element class found for second element.');
}