mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fix merge errors and regressions
This commit is contained in:
parent
dff65867cc
commit
e7619feadb
@ -177,30 +177,6 @@ class NumericFieldTest extends SapphireTest {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test empty values
|
||||
*/
|
||||
public function testEmptyValidator() {
|
||||
i18n::set_locale('en_US');
|
||||
$field = new NumericField('Number');
|
||||
|
||||
// Treats '0' as given for the sake of required fields
|
||||
$field->setValue('0');
|
||||
$this->assertTrue($field->validate($validator));
|
||||
$this->assertEquals(0, $field->dataValue());
|
||||
|
||||
// Treat literal 0
|
||||
$field->setValue(0);
|
||||
$this->assertTrue($field->validate($validator));
|
||||
$this->assertEquals(0, $field->dataValue());
|
||||
|
||||
// Should fail the 'required but not given' test
|
||||
$field->setValue('');
|
||||
$this->assertFalse($field->validate($validator));
|
||||
|
||||
$field->setValue(false);
|
||||
}
|
||||
|
||||
public function testReadonly() {
|
||||
i18n::set_locale('en_US');
|
||||
$field = new NumericField('Number');
|
||||
|
Loading…
x
Reference in New Issue
Block a user