diff -u b/core/modules/system/src/Tests/Form/ElementTest.php b/core/modules/system/src/Tests/Form/ElementTest.php --- b/core/modules/system/src/Tests/Form/ElementTest.php +++ b/core/modules/system/src/Tests/Form/ElementTest.php @@ -106,6 +106,9 @@ // A default value of FALSE indicates that nothing is set. $elements = $this->xpath('//input[@name="radios-boolean-false" and @checked]'); $this->assertEqual(count($elements), 0); + $elements = $this->xpath('//input[@name="radios-boolean-any" and @checked]'); + $this->assertEqual(count($elements), 1); + $this->assertIdentical((string) $elements[0]['value'], 'All'); } /** diff -u b/core/modules/system/tests/modules/form_test/src/Form/FormTestRadiosCheckedForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRadiosCheckedForm.php --- b/core/modules/system/tests/modules/form_test/src/Form/FormTestRadiosCheckedForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRadiosCheckedForm.php @@ -66,6 +66,16 @@ ], '#default_value' => FALSE, ]; + $form['radios-boolean-any'] = [ + '#type' => 'radios', + '#title' => 'Radios', + '#options' => [ + 'All' => '- Any -', + 1 => 'True', + 0 => 'False', + ], + '#default_value' => 'All', + ]; $form['submit'] = ['#type' => 'submit', '#value' => 'Submit'];