summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-12 00:30:24 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-12 00:30:24 -0700
commit6c4381e1c1f1998b6bdb66f915eaac391a66594d (patch)
tree76c53132890df46c60bd652ed4b808387914f39e /modules/simpletest/tests
parentec36276c4ef52066a5e653d82450bd94c22824b5 (diff)
downloadbrdo-6c4381e1c1f1998b6bdb66f915eaac391a66594d.tar.gz
brdo-6c4381e1c1f1998b6bdb66f915eaac391a66594d.tar.bz2
Issue #1421410 by andypost, Niklas Fiekas: Fixed not defined in form_pre_render_conditional_form_element().
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/form.test6
-rw-r--r--modules/simpletest/tests/form_test.module23
2 files changed, 28 insertions, 1 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index ec7df2c33..df8d3f27f 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -703,6 +703,12 @@ 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 title attribute for radios and checkboxes.
+ $elements = $this->xpath('//div[@id="edit-form-checkboxes-title-attribute"]');
+ $this->assertEqual($elements[0]['title'], 'Checkboxes test' . ' (' . t('Required') . ')', 'Title attribute found.');
+ $elements = $this->xpath('//div[@id="edit-form-radios-title-attribute"]');
+ $this->assertEqual($elements[0]['title'], 'Radios test' . ' (' . t('Required') . ')', 'Title attribute found.');
}
}
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index 1c16c39c7..43a6cbecb 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -791,10 +791,31 @@ function form_label_test_form() {
'#title' => t('Textfield test for invisible title'),
'#title_display' => 'invisible',
);
- // Textfield test for title set not to display
+ // Textfield test for title set not to display.
$form['form_textfield_test_title_no_show'] = array(
'#type' => 'textfield',
);
+ // Checkboxes & radios with title as attribute.
+ $form['form_checkboxes_title_attribute'] = array(
+ '#type' => 'checkboxes',
+ '#title' => 'Checkboxes test',
+ '#options' => array(
+ 'first-checkbox' => 'First checkbox',
+ 'second-checkbox' => 'Second checkbox',
+ ),
+ '#title_display' => 'attribute',
+ '#required' => TRUE,
+ );
+ $form['form_radios_title_attribute'] = array(
+ '#type' => 'radios',
+ '#title' => 'Radios test',
+ '#options' => array(
+ 'first-radio' => 'First radio',
+ 'second-radio' => 'Second radio',
+ ),
+ '#title_display' => 'attribute',
+ '#required' => TRUE,
+ );
return $form;
}