mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Refactor duplicate code
This commit is contained in:
+12
-10
@@ -1142,19 +1142,21 @@ class UuidTest extends TestCase
|
||||
$factory = new UuidFactory();
|
||||
$smallIntFactory = new UuidFactory(new FeatureSet(false, true));
|
||||
|
||||
$timeOfDay = new FixedTimeProvider(array(
|
||||
'sec' => $currentTime,
|
||||
'usec' => $usec,
|
||||
'minuteswest' => 0,
|
||||
'dsttime' => 0,
|
||||
));
|
||||
|
||||
$factory->setTimeProvider($timeOfDay);
|
||||
$smallIntFactory->setTimeProvider($timeOfDay);
|
||||
|
||||
while ($currentTime <= $endTime) {
|
||||
|
||||
foreach (array(0, 50000, 250000, 500000, 750000, 999999) as $usec) {
|
||||
|
||||
$timeOfDay = new FixedTimeProvider(array(
|
||||
'sec' => $currentTime,
|
||||
'usec' => $usec,
|
||||
'minuteswest' => 0,
|
||||
'dsttime' => 0,
|
||||
));
|
||||
|
||||
$factory->setTimeProvider($timeOfDay);
|
||||
$smallIntFactory->setTimeProvider($timeOfDay);
|
||||
$timeOfDay->setSec($currentTime);
|
||||
$timeOfDay->setUsec($usec);
|
||||
|
||||
$uuid32 = $smallIntFactory->uuid1(0x00007ffffffe, 0x1669);
|
||||
$uuid64 = $factory->uuid1(0x00007ffffffe, 0x1669);
|
||||
|
||||
Reference in New Issue
Block a user