diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
index 45959f1..5ed0512 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
@@ -37,7 +37,7 @@ function testFormCheckbox() {
       // #return_value, with the exception of integer 0, which is not supported.
       // @see form_process_checkbox().
       foreach (array('0', '', 1, '1', 'foobar', '1foobar') as $return_value) {
-        $form_array = drupal_get_form('form_test_checkbox_type_juggling', $default_value, $return_value);
+        $form_array = drupal_get_form('form_test_type_juggling', $default_value, $return_value, 'checkbox');
         $form = drupal_render($form_array);
         if ($default_value === TRUE) {
           $checked = TRUE;
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/RadioTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/RadioTest.php
new file mode 100644
index 0000000..cb99897
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/RadioTest.php
@@ -0,0 +1,95 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Form\RadioTest.
+ */
+
+namespace Drupal\system\Tests\Form;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests radio button element.
+ */
+class RadioTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('form_test');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Form API radio button',
+      'description' => 'Tests form API radio button handling of various combinations of #default_value and #return_value.',
+      'group' => 'Form API',
+    );
+  }
+
+  function testFormRadio() {
+    // Ensure that the checked state is determined and rendered correctly for
+    // tricky combinations of default and return values.
+    foreach (array(FALSE, NULL, TRUE, 0, '0', '', 1, '1', 'foobar', '1foobar') as $default_value) {
+      // Only values that can be used for array indices are supported for
+      // #return_value, with the exception of integer 0, which is not supported.
+      // @see form_process_checkbox().
+      foreach (array('0', '', 1, '1', 'foobar', '1foobar') as $return_value) {
+        $form_array = drupal_get_form('form_test_type_juggling', $default_value, $return_value, 'radio');
+        $form = drupal_render($form_array);
+        if ($default_value === TRUE) {
+          $checked = TRUE;
+        }
+        elseif ($return_value === '0') {
+          $checked = ($default_value === '0');
+        }
+        elseif ($return_value === '') {
+          $checked = ($default_value === '');
+        }
+        elseif ($return_value === 1 || $return_value === '1') {
+          $checked = ($default_value === 1 || $default_value === '1');
+        }
+        elseif ($return_value === 'foobar') {
+          $checked = ($default_value === 'foobar');
+        }
+        elseif ($return_value === '1foobar') {
+          $checked = ($default_value === '1foobar');
+        }
+        $checked_in_html = strpos($form, 'checked') !== FALSE;
+        $message = format_string('#default_value is %default_value #return_value is %return_value.', array('%default_value' => var_export($default_value, TRUE), '%return_value' => var_export($return_value, TRUE)));
+        $this->assertIdentical($checked, $checked_in_html, $message);
+      }
+    }
+
+    // Ensure that $form_state['values'] is populated correctly for a radio
+    // group that includes a 0-indexed array of options.
+    $results = json_decode($this->drupalPost('form-test/radios-zero', array(), 'Save'));
+    // dsm($results, 'results from form-test/radios-zero');
+    $this->assertIdentical($results->radio_off, array(0, 0, 0), 'All three in radio_off are zeroes: off.');
+    $this->assertIdentical($results->radio_zero_default, array('0', 0, 0), 'The first choice is on in radio_zero_default');
+    $this->assertIdentical($results->radio_string_zero_default, array('0', 0, 0), 'The first choice is on in radio_string_zero_default');
+    $edit = array('radio_off[0]' => '0');
+    $results = json_decode($this->drupalPost('form-test/radios-zero', $edit, 'Save'));
+    $this->assertIdentical($results->radio_off, array('0', 0, 0), 'The first choice is on in radio_off but the rest is not');
+
+    // Ensure that each radio is rendered correctly for a radios group
+    // that includes a 0-indexed array of options.
+    $this->drupalPost('form-test/radios-zero/0', array(), 'Save');
+    $radios = $this->xpath('//input[@type="radio"]');
+    foreach ($radios as $radio) {
+      $checked = isset($radio['checked']);
+      $name = (string) $radio['name'];
+      $this->assertIdentical($checked, $name == 'radio_zero_default[0]' || $name == 'radio_string_zero_default[0]', format_string('radio %name correctly checked', array('%name' => $name)));
+    }
+    $edit = array('radio_off[0]' => '0');
+    $this->drupalPost('form-test/radios-zero/0', $edit, 'Save');
+    $radios = $this->xpath('//input[@type="radio"]');
+    foreach ($radios as $radio) {
+      $checked = isset($radio['checked']);
+      $name = (string) $radio['name'];
+      $this->assertIdentical($checked, $name == 'radio_off[0]' || $name == 'radio_zero_default[0]' || $name == 'radio_string_zero_default[0]', format_string('Radio %name correctly checked', array('%name' => $name)));
+    }
+  }
+}
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 762d7fc..0793e90 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -311,6 +311,7 @@ function form_test_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+
   $items['form-test/checkboxes-zero'] = array(
     'title' => 'FAPI test involving checkboxes and zero',
     'page callback' => 'drupal_get_form',
@@ -319,6 +320,14 @@ function form_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['form-test/radios-zero'] = array(
+    'title' => 'FAPI test involving radio buttons and zero',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('form_test_radios_zero'),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+
   $items['form-test/required-attribute'] = array(
     'title' => 'Required',
     'page callback' => 'drupal_get_form',
@@ -2291,9 +2300,9 @@ function form_test_load_include_custom($form, &$form_state) {
   return $form;
 }
 
-function form_test_checkbox_type_juggling($form, $form_state, $default_value, $return_value) {
-  $form['checkbox'] = array(
-    '#type' => 'checkbox',
+function form_test_type_juggling($form, $form_state, $default_value, $return_value, $element_type = 'checkbox') {
+  $form[$element_type] = array(
+    '#type' => $element_type,
     '#return_value' => $return_value,
     '#default_value' => $default_value,
   );
@@ -2328,10 +2337,38 @@ function form_test_checkboxes_zero($form, &$form_state, $json = TRUE) {
   return $form;
 }
 
-function _form_test_checkboxes_zero_no_redirect($form, &$form_state) {
+function _form_test_no_redirect($form, &$form_state) {
   $form_state['redirect'] = FALSE;
 }
 
+function form_test_radios_zero($form, &$form_state, $json = TRUE) {
+  $form['radio_off'] = array(
+    '#type' => 'radioes',
+    '#options' => array('foo', 'bar', 'baz'),
+  );
+  $form['radio_zero_default'] = array(
+    '#type' => 'radioes',
+    '#options' => array('foo', 'bar', 'baz'),
+    '#default_value' => array(0),
+  );
+  $form['radio_string_zero_default'] = array(
+    '#type' => 'radioes',
+    '#options' => array('foo', 'bar', 'baz'),
+    '#default_value' => array('0'),
+  );
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => 'Save',
+  );
+  if ($json) {
+    $form['#submit'][] = '_form_test_submit_values_json';
+  }
+  else {
+    $form['#submit'][] = '_form_test_no_redirect';
+  }
+  return $form;
+}
+
 /**
  * Builds a form to test the required attribute.
  */
