mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-16 16:17:43 +03:00
@@ -10,34 +10,6 @@ use Ramsey\Uuid\Type\Time;
|
||||
|
||||
class FixedTimeProviderTest extends TestCase
|
||||
{
|
||||
public function testConstructorRequiresSecAndUsec(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Array must contain sec and usec keys.');
|
||||
|
||||
new FixedTimeProvider([]);
|
||||
}
|
||||
|
||||
public function testCurrentTimeReturnsTimestamp(): void
|
||||
{
|
||||
$timestamp = ['sec' => 1458844556, 'usec' => 200997];
|
||||
$provider = new FixedTimeProvider($timestamp);
|
||||
|
||||
$this->assertEquals($timestamp, $provider->currentTime());
|
||||
}
|
||||
|
||||
public function testCurrentTimeReturnsTimestampAfterChange(): void
|
||||
{
|
||||
$timestamp = ['sec' => 1458844556, 'usec' => 200997];
|
||||
$provider = new FixedTimeProvider($timestamp);
|
||||
|
||||
$newTimestamp = ['sec' => 1050804050, 'usec' => 30192];
|
||||
$provider->setSec($newTimestamp['sec']);
|
||||
$provider->setUsec($newTimestamp['usec']);
|
||||
|
||||
$this->assertEquals($newTimestamp, $provider->currentTime());
|
||||
}
|
||||
|
||||
public function testGetTimeReturnsTime(): void
|
||||
{
|
||||
$time = new Time(1458844556, 200997);
|
||||
|
||||
Reference in New Issue
Block a user