Files
php-uuid/tests/Converter/Time/DegradedTimeConverterTest.php
T
Ben Ramsey 0d7b8c2b7a Update coding style to include PSR-12, among other options
This also includes heavy use of slevomat/coding-standard to apply
various checks to the code, based on maintainer (me) preference.
2020-01-18 12:13:55 -06:00

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');
}
}