diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php index 7be8e3c..6bb606b 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php @@ -66,10 +66,10 @@ function testOptionsAllowedValuesInteger() { $array = array('0' => 'Zero', '2' => 'Two'); $this->assertAllowedValuesInput($string, $array, 'Integer keys are accepted.'); - // Check keys if there are leading zeros. + // Add keys that have leading zeros and verify that are not stored as strings. $string = "00|Zero\n02|Two"; $array = array('00' => 'Zero', '02' => 'Two'); - $this->assertAllowedValuesInput($string, $array, 'Integer keys fail if there are leading zeros.'); + $this->assertAllowedValuesInput($string, $array, 'Keys that have leading zeros are not stored as strings.'); // Check that values can be added and removed. $string = "0|Zero\n1|One"; @@ -302,6 +302,8 @@ function assertAllowedValuesInput($input_string, $result, $message) { else { field_info_cache_clear(); $field = field_info_field('node', $this->field_name); + + // Keys are stored as integers, so for the key "00" the stored key should be 0. if ($this->field_name == 'field_options_integer' && !isset($result[0])) { $this->assertNotIdentical($field->getFieldSetting('allowed_values'), $result, $message); return;