diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-12-22 02:14:53 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-12-22 02:14:53 -0800 |
commit | fa4d4c5ce3c9e2d156ea00ca3d3299ac90d37a3b (patch) | |
tree | 0b43206fbd961f9ba8c969ab1634e85f3708966d /modules | |
parent | 4735a9bf59c7428c96f5b6ad769ad11d4d7a618f (diff) | |
download | brdo-fa4d4c5ce3c9e2d156ea00ca3d3299ac90d37a3b.tar.gz brdo-fa4d4c5ce3c9e2d156ea00ca3d3299ac90d37a3b.tar.bz2 |
Issue #866292 by marcingy, ygerasimov, quicksketch, attiks, furamag: Fixed '0' not displayed as checkbox / radios options (nor as any element #title).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/form.test | 8 | ||||
-rw-r--r-- | modules/simpletest/tests/form_test.module | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index fe2c1bbfb..13fdca201 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -588,9 +588,17 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase { $elements = $this->xpath('//input[@id="edit-form-checkboxes-test-third-checkbox"]/following-sibling::label[@for="edit-form-checkboxes-test-third-checkbox" and @class="option"]'); $this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular checkboxes.")); + // Make sure the label is rendered for checkboxes. + $elements = $this->xpath('//input[@id="edit-form-checkboxes-test-0"]/following-sibling::label[@for="edit-form-checkboxes-test-0" and @class="option"]'); + $this->assertTrue(isset($elements[0]), t("Label 0 found checkbox.")); + $elements = $this->xpath('//input[@id="edit-form-radios-test-second-radio"]/following-sibling::label[@for="edit-form-radios-test-second-radio" and @class="option"]'); $this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular radios.")); + // Make sure the label is rendered for radios. + $elements = $this->xpath('//input[@id="edit-form-radios-test-0"]/following-sibling::label[@for="edit-form-radios-test-0" and @class="option"]'); + $this->assertTrue(isset($elements[0]), t("Label 0 found radios.")); + // Exercise various defaults for checkboxes and modifications to ensure // appropriate override and correct behaviour. $elements = $this->xpath('//input[@id="edit-form-checkbox-test"]/following-sibling::label[@for="edit-form-checkbox-test" and @class="option"]'); diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module index 23aca244b..0a748d2df 100644 --- a/modules/simpletest/tests/form_test.module +++ b/modules/simpletest/tests/form_test.module @@ -688,6 +688,7 @@ function form_label_test_form() { 'first-checkbox' => t('First checkbox'), 'second-checkbox' => t('Second checkbox'), 'third-checkbox' => t('Third checkbox'), + '0' => t('0'), ), ); $form['form_radios_test'] = array( @@ -697,6 +698,7 @@ function form_label_test_form() { 'first-radio' => t('First radio'), 'second-radio' => t('Second radio'), 'third-radio' => t('Third radio'), + '0' => t('0'), ), // Test #field_prefix and #field_suffix placement. '#field_prefix' => '<span id="form-test-radios-field-prefix">' . t('Radios #field_prefix element') . '</span>', |