diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php index 1fa1c4b..a82eafb 100644 --- a/core/modules/field/src/Tests/Number/NumberFieldTest.php +++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php @@ -477,20 +477,28 @@ function testCreateNumberFloatField() { 'bundle' => 'entity_test', ))->save(); + $field_configuration_url = 'entity_test/structure/entity_test/fields/entity_test.entity_test.' . $field_name; + // Set the minimum value to a decimal value. $edit = array( 'field[settings][min]' => 0.1, ); - $this->drupalPostForm('entity_test/structure/entity_test/fields/entity_test.entity_test.' . $field_name, $edit, t('Save settings')); + $this->drupalPostForm($field_configuration_url, $edit, t('Save settings')); // Check if an error message is shown. $this->assertNoRaw(t('%name is not a valid number.', array('%name' => t('Minimum'))), 'Saved decimal value as minimal value on a float field'); + // Check if the minimum value was actually set. + $this->drupalGet($field_configuration_url); + $this->assertFieldById('edit-field-settings-min', 0.1, 'Minimal decimal value was set on a float field.'); // Set the minimum value to an integer value. $edit = array( 'field[settings][min]' => 1, ); - $this->drupalPostForm('entity_test/structure/entity_test/fields/entity_test.entity_test.' . $field_name, $edit, t('Save settings')); + $this->drupalPostForm($field_configuration_url, $edit, t('Save settings')); // Check if an error message is shown. $this->assertNoRaw(t('%name is not a valid number.', array('%name' => t('Minimum'))), 'Saved integer value as minimal value on a float field'); + // Check if the minimum value was actually set. + $this->drupalGet($field_configuration_url); + $this->assertFieldById('edit-field-settings-min', 1, 'Minimal integer value was set on a float field.'); } }