Skip to content

Commit f0e4edf

Browse files
authored
Merge pull request #25 from ximarx/microtime-as-string
2 parents f8950af + 98893f5 commit f0e4edf

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/ClockMock.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ private static function mock_microtime(): callable
324324
if ($as_float) {
325325
return (float) self::$frozenDateTime->format('U.u');
326326
}
327-
328-
return self::$frozenDateTime->format('0.u U');
327+
return self::$frozenDateTime->format('0.u00 U');
329328
};
330329

331330
return fn (bool $as_float = false) => $microtime_mock($as_float);

tests/ClockMockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function test_microtime()
349349
{
350350
ClockMock::freeze(new \DateTime('@1619000631.123456'));
351351

352-
$this->assertEquals('0.123456 1619000631', microtime());
352+
$this->assertEquals('0.12345600 1619000631', microtime());
353353
$this->assertSame(1619000631.123456, microtime(true));
354354
}
355355

0 commit comments

Comments
 (0)