summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-04-01 17:47:54 -0400
committerDavid Rothstein <drothstein@gmail.com>2013-04-01 17:47:54 -0400
commit154389daa596af81da96de7a067f3ef72cc2f2a4 (patch)
tree52929594b0314e1957258f89fff8eca6a38b5deb /modules/simpletest
parent005708cec562a368fb9b4cf997f034412b757360 (diff)
downloadbrdo-154389daa596af81da96de7a067f3ef72cc2f2a4.tar.gz
brdo-154389daa596af81da96de7a067f3ef72cc2f2a4.tar.bz2
Issue #799356 by vijaycs85, m1n0, jaffaralia, effulgentsia: Fixed _form_set_class() is too aggressive in assigning the 'error' class.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/form.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index 7eac198ad..7c44b1bed 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -657,6 +657,17 @@ class FormValidationTestCase extends DrupalWebTestCase {
$this->assertText(t('!name field is required.', array('!name' => 'Title')));
$this->assertText('Test element is invalid');
}
+
+ /**
+ * 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.');
+ }
}
/**