mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-25 17:45:35 +03:00
0d7b8c2b7a
This also includes heavy use of slevomat/coding-standard to apply various checks to the code, based on maintainer (me) preference.
43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Ramsey\Uuid\Test\Converter\Time;
|
|
|
|
use Ramsey\Uuid\Converter\Time\DegradedTimeConverter;
|
|
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
|
|
use Ramsey\Uuid\Test\TestCase;
|
|
|
|
class DegradedTimeConverterTest extends TestCase
|
|
{
|
|
public function testCalculateTimeThrowsException(): void
|
|
{
|
|
$converter = new DegradedTimeConverter();
|
|
|
|
$this->expectException(UnsatisfiedDependencyException::class);
|
|
$this->expectExceptionMessage(
|
|
'Cannot call calculateTime using the DegradedTimeConverter; '
|
|
. 'please choose a converter with support for large integers; '
|
|
. 'refer to the ramsey/uuid wiki for more information: '
|
|
. 'https://github.com/ramsey/uuid/wiki'
|
|
);
|
|
|
|
$converter->calculateTime('123', '123');
|
|
}
|
|
|
|
public function testConvertTimeThrowsException(): void
|
|
{
|
|
$converter = new DegradedTimeConverter();
|
|
|
|
$this->expectException(UnsatisfiedDependencyException::class);
|
|
$this->expectExceptionMessage(
|
|
'Cannot call convertTime using the DegradedTimeConverter; '
|
|
. 'please choose a converter with support for large integers; '
|
|
. 'refer to the ramsey/uuid wiki for more information: '
|
|
. 'https://github.com/ramsey/uuid/wiki'
|
|
);
|
|
|
|
$converter->convertTime('123');
|
|
}
|
|
}
|