diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php index 07591f5..c662ec7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php @@ -653,4 +653,15 @@ function testRequiredAttribute() { )); $this->assertTrue(!empty($element), 'The textarea has the proper required attribute.'); } + + /** + * Tests error border of multiple fields with same name in a page. + */ + function testMultiFormSameNameErrorClass() { + $this->drupalGet('form-test/double-form'); + $edit = array(); + $this->drupalPost(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.'); + } }