Skip to content

Commit

Permalink
Correctly format microseconds in test
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Dec 29, 2016
1 parent 79b10d4 commit 7f46318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 7f46318

Please sign in to comment.