diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-23 00:32:11 -0600 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-23 00:32:11 -0600 |
commit | ea8e74bbd494ce2f8d6e5bf38e1596fe014a1b85 (patch) | |
tree | 0c23a403c70bdecfaa971cfcaae66dbaccde93de /modules/simpletest | |
parent | 90342de35cd9e0aa401ed5999674fbc0f4d0e23e (diff) | |
download | brdo-ea8e74bbd494ce2f8d6e5bf38e1596fe014a1b85.tar.gz brdo-ea8e74bbd494ce2f8d6e5bf38e1596fe014a1b85.tar.bz2 |
Issue #1475666 by filijonka, Niklas Fiekas, Devin Carlson, Kevin Morse, tstoeckler: Fixed PHP error because of typo in form.inc line 3025.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/form.test | 5 | ||||
-rw-r--r-- | modules/simpletest/tests/form_test.module | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index ec7df2c33..1766126a8 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -703,6 +703,11 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase { $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.")); + + // Check that required checkboxes with #title_display attribute have + // a description but no title is displayed. + $this->assertFieldByXPath('//div[contains(@class, "form-item-form-checkboxes-test-title-display-attribute")]/div[contains(@class, "description")]', NULL, 'Description displayed for #title_display attribute.'); + $this->assertNoFieldByXPath('//label[@for="edit-form-checkboxes-test-title-display-attribute"]', NULL, 'No title displayed for #title_display attribute.'); } } diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module index 1c16c39c7..3a8c4ca12 100644 --- a/modules/simpletest/tests/form_test.module +++ b/modules/simpletest/tests/form_test.module @@ -795,6 +795,15 @@ function form_label_test_form() { $form['form_textfield_test_title_no_show'] = array( '#type' => 'textfield', ); + // Test required checkboxes with #title_display attribute and a description. + $form['form_checkboxes_test_title_display_attribute'] = array( + '#type' => 'checkboxes', + '#title' => 'Checkboxes, #title_display attribute', + '#title_display' => 'attribute', + '#required' => TRUE, + '#description' => 'Required checkboxes with #title_display attribute and a description.', + '#options' => drupal_map_assoc(array('foo', 'bar', 'baz')), + ); return $form; } |