Skip to content

Commit

Permalink
Merge pull request #25 from ximarx/microtime-as-string
Browse files Browse the repository at this point in the history
  • Loading branch information
asprega committed Oct 14, 2022
2 parents f8950af + 98893f5 commit f0e4edf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/ClockMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ private static function mock_microtime(): callable
if ($as_float) {
return (float) self::$frozenDateTime->format('U.u');
}

return self::$frozenDateTime->format('0.u U');
return self::$frozenDateTime->format('0.u00 U');
};

return fn (bool $as_float = false) => $microtime_mock($as_float);
Expand Down
2 changes: 1 addition & 1 deletion tests/ClockMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function test_microtime()
{
ClockMock::freeze(new \DateTime('@1619000631.123456'));

$this->assertEquals('0.123456 1619000631', microtime());
$this->assertEquals('0.12345600 1619000631', microtime());
$this->assertSame(1619000631.123456, microtime(true));
}

Expand Down

0 comments on commit f0e4edf

Please sign in to comment.