From 4de7829e4cb50f06a8fbbbe3300cb0aca05de73f Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 7 Sep 2012 16:23:59 +1200 Subject: [PATCH] Use more robust Format() in test instead of strtotime() --- tests/MSSQLDatabaseQueryTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/MSSQLDatabaseQueryTest.php b/tests/MSSQLDatabaseQueryTest.php index 86af785..68f4ba7 100644 --- a/tests/MSSQLDatabaseQueryTest.php +++ b/tests/MSSQLDatabaseQueryTest.php @@ -4,17 +4,17 @@ class MSSQLDatabaseQueryTest extends SapphireTest { public static $fixture_file = 'MSSQLDatabaseQueryTest.yml'; protected $extraDataObjects = array( - 'MSSQLDatabaseQueryTestDataObject' + 'MSSQLDatabaseQueryTestDataObject' ); public function testDateValueFormatting() { $obj = $this->objFromFixture('MSSQLDatabaseQueryTestDataObject', 'test-data-1'); - $this->assertEquals('2012-01-01', date('Y-m-d', strtotime($obj->TestDate)), 'Date field value is formatted correctly (Y-m-d)'); + $this->assertEquals('2012-01-01', $obj->obj('TestDate')->Format('Y-m-d'), 'Date field value is formatted correctly (Y-m-d)'); } public function testDatetimeValueFormatting() { $obj = $this->objFromFixture('MSSQLDatabaseQueryTestDataObject', 'test-data-1'); - $this->assertEquals('2012-01-01 10:30:00', $obj->TestDatetime, 'Datetime field value is formatted correctly (Y-m-d H:i:s)'); + $this->assertEquals('2012-01-01 10:30:00', $obj->obj('TestDatetime')->Format('Y-m-d H:i:s'), 'Datetime field value is formatted correctly (Y-m-d H:i:s)'); } }