diff options
author | David Rothstein <drothstein@gmail.com> | 2012-07-29 16:05:06 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2012-07-29 16:05:06 -0400 |
commit | 331a3756c369eb4f08272a7a5721a13fd841dfae (patch) | |
tree | 13fcfcf5f498c732bf4f95ee12bb2f6bc4c280c0 /modules/simpletest/tests | |
parent | 568611ec397a2fb663988b04cf9105af68d4a1ba (diff) | |
download | brdo-331a3756c369eb4f08272a7a5721a13fd841dfae.tar.gz brdo-331a3756c369eb4f08272a7a5721a13fd841dfae.tar.bz2 |
Issue #811542 by David_Rothstein, attiks, thekevinday, effulgentsia, chx: Fixed Regression: Optional radio buttons with an empty, non-NULL default value led to an illegal choice error when none were selected.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/form.test | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/form_test.module | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index 2f5a9cd14..5aa7e4aa3 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -173,6 +173,8 @@ class FormsTestCase extends DrupalWebTestCase { $this->assertNoFieldChecked('edit-radios-bar'); $this->assertNoFieldChecked('edit-radios-optional-foo'); $this->assertNoFieldChecked('edit-radios-optional-bar'); + $this->assertNoFieldChecked('edit-radios-optional-default-value-false-foo'); + $this->assertNoFieldChecked('edit-radios-optional-default-value-false-bar'); // Submit again with required fields set and verify that there are no // error messages. diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module index 43a6cbecb..a6b21a41a 100644 --- a/modules/simpletest/tests/form_test.module +++ b/modules/simpletest/tests/form_test.module @@ -372,6 +372,12 @@ function form_test_validate_required_form($form, &$form_state) { '#title' => 'Radios (optional)', '#options' => $options, ); + $form['radios_optional_default_value_false'] = array( + '#type' => 'radios', + '#title' => 'Radios (optional, with a default value of FALSE)', + '#options' => $options, + '#default_value' => FALSE, + ); $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => 'Submit'); return $form; |