From 7f46318affe76ed48a22f1c21d76733dc3e64441 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Sun, 25 Dec 2016 15:13:46 +0100 Subject: [PATCH] Correctly format microseconds in test --- tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php index cbd3fe48cd..032cc3ec08 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php @@ -79,7 +79,7 @@ public function testConvertDatePreservesMilliseconds() $expectedDate = clone $date; $cleanMicroseconds = (int) floor(((int) $date->format('u')) / 1000) * 1000; - $expectedDate->modify($date->format('H:i:s') . '.' . $cleanMicroseconds); + $expectedDate->modify($date->format('H:i:s') . '.' . str_pad($cleanMicroseconds, 6, '0', STR_PAD_LEFT)); $type = Type::getType(Type::DATE); $this->assertEquals($expectedDate, $type->convertToPHPValue($type->convertToDatabaseValue($date)));