mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Fix: Move tests one up
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Ramsey\Uuid\Test\Provider\Time;
|
||||
|
||||
use Ramsey\Uuid\Provider\Time\SystemTimeProvider;
|
||||
use Ramsey\Uuid\Test\TestCase;
|
||||
use AspectMock\Test as AspectMock;
|
||||
|
||||
class SystemTimeProviderTest extends TestCase
|
||||
{
|
||||
|
||||
public function testCurrentTimeReturnsTimestampArray()
|
||||
{
|
||||
$provider = new SystemTimeProvider();
|
||||
$time = $provider->currentTime();
|
||||
$this->assertArrayHasKey('sec', $time);
|
||||
$this->assertArrayHasKey('usec', $time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testCurrentTimeUsesGettimeofday()
|
||||
{
|
||||
$this->skipIfHhvm();
|
||||
$timestamp = ['sec' => 1458844556, 'usec' => 200997];
|
||||
$func = AspectMock::func('Ramsey\Uuid\Provider\Time', 'gettimeofday', $timestamp);
|
||||
$provider = new SystemTimeProvider();
|
||||
$provider->currentTime();
|
||||
$func->verifyInvokedOnce();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user