diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-28 16:11:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-28 16:11:22 +0000 |
commit | 7745a082d0fcb1096791d719443699da6cc7e8db (patch) | |
tree | b9ca27003f1833986eb4c37ec5c421081b0b2291 /modules/simpletest/tests/form.test | |
parent | 680dae6e785bfbc9b664196fbec373fd180a2c4e (diff) | |
download | brdo-7745a082d0fcb1096791d719443699da6cc7e8db.tar.gz brdo-7745a082d0fcb1096791d719443699da6cc7e8db.tar.bz2 |
- Patch #755030 by jhedstrom, sivaji, kkaefer: #field_prefix()/suffix is displayed before the label. With tests.
Diffstat (limited to 'modules/simpletest/tests/form.test')
-rw-r--r-- | modules/simpletest/tests/form.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index 40c7490da..0181dcafb 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -375,6 +375,20 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase { $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-no-show"]'); $this->assertFalse(isset($elements[0]), t("No label tag when title set not to display.")); + + // Check #field_prefix and #field_suffix placement. + $elements = $this->xpath('//span[@class="field-prefix"]/following-sibling::div[@id="edit-form-radios-test"]'); + $this->assertTrue(isset($elements[0]), t("Properly placed the #field_prefix element after the label and before the field.")); + + $elements = $this->xpath('//span[@class="field-suffix"]/preceding-sibling::div[@id="edit-form-radios-test"]'); + $this->assertTrue(isset($elements[0]), t("Properly places the #field_suffix element immediately after the form field.")); + + // Check #prefix and #suffix placement. + $elements = $this->xpath('//div[@id="form-test-textfield-title-prefix"]/following-sibling::div[contains(@class, \'form-item-form-textfield-test-title\')]'); + $this->assertTrue(isset($elements[0]), t("Properly places the #prefix element before the form item.")); + + $elements = $this->xpath('//div[@id="form-test-textfield-title-suffix"]/preceding-sibling::div[contains(@class, \'form-item-form-textfield-test-title\')]'); + $this->assertTrue(isset($elements[0]), t("Properly places the #suffix element before the form item.")); } } |