Skip to content

Commit d0ea93f

Browse files
authored
Test getTime 10 times within a second (#33)
1 parent 651ce89 commit d0ea93f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/UuidTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,14 @@ public function testKnownGetTime()
197197

198198
public function testGetTimeValid()
199199
{
200-
$now = microtime(true);
201-
$uuid6 = UUID::uuid6();
202-
$uuid7 = UUID::uuid7();
203-
$this->assertEqualsWithDelta($now, UUID::getTime($uuid6), 0.001);
204-
$this->assertEqualsWithDelta($now, UUID::getTime($uuid7), 0.001);
200+
for ($i = 1; $i <= 10; $i++) {
201+
$now = microtime(true);
202+
$uuid6 = UUID::uuid6();
203+
$uuid7 = UUID::uuid7();
204+
$this->assertEqualsWithDelta($now, UUID::getTime($uuid6), 0.001);
205+
$this->assertEqualsWithDelta($now, UUID::getTime($uuid7), 0.001);
206+
usleep(100000);
207+
}
205208
}
206209

207210
public function testGetTimeNull()

0 commit comments

Comments
 (0)