From c414388220614118d132083697a54c5d81e8fccc Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 14 Jun 2018 18:14:12 +1200 Subject: [PATCH] FIX DatetimeFieldTest --- tests/php/Forms/DatetimeFieldTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/php/Forms/DatetimeFieldTest.php b/tests/php/Forms/DatetimeFieldTest.php index dd8587b49..d3ca4db24 100644 --- a/tests/php/Forms/DatetimeFieldTest.php +++ b/tests/php/Forms/DatetimeFieldTest.php @@ -109,11 +109,11 @@ class DatetimeFieldTest extends SapphireTest { $f = new DatetimeField('Datetime', 'Datetime'); $f->setValue('2003-03-29 23:59:38'); - $this->assertEquals($f->dataValue(), '2003-03-29 23:59:38', 'Accepts ISO'); + $this->assertEquals('2003-03-29 23:59:38', $f->dataValue(), 'Accepts ISO'); $f = new DatetimeField('Datetime', 'Datetime'); $f->setValue('2003-03-29T23:59:38'); - $this->assertNull($f->dataValue(), 'Rejects normalised ISO'); + $this->assertEquals('2003-03-29 23:59:38', $f->dataValue(), 'Accepts normalised ISO'); } public function testSubmittedValue() @@ -152,7 +152,7 @@ class DatetimeFieldTest extends SapphireTest $this->assertTrue($f->validate(new RequiredFields())); $f = new DatetimeField('Datetime', 'Datetime', '2003-03-29T23:59:38'); - $this->assertFalse($f->validate(new RequiredFields()), 'Normalised ISO'); + $this->assertTrue($f->validate(new RequiredFields()), 'Normalised ISO'); $f = new DatetimeField('Datetime', 'Datetime', '2003-03-29'); $this->assertFalse($f->validate(new RequiredFields()), 'Leaving out time');