diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index 33dae91..9cc4a43 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -29,8 +29,8 @@ class OrderedTimeCodecTest extends TestCase protected function setUp() { parent::setUp(); - $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); - $this->uuid = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); + $this->builder = $this->getMockBuilder(UuidBuilderInterface::class)->getMock(); + $this->uuid = $this->getMockBuilder(UuidInterface::class)->getMock(); $this->fields = ['time_low' => '58e0a7d7', 'time_mid' => 'eebc', 'time_hi_and_version' => '11d8', diff --git a/tests/UuidFactoryTest.php b/tests/UuidFactoryTest.php index cf6dcc6..f722d0e 100644 --- a/tests/UuidFactoryTest.php +++ b/tests/UuidFactoryTest.php @@ -4,6 +4,12 @@ namespace Ramsey\Uuid\Test; use Ramsey\Uuid\FeatureSet; use Ramsey\Uuid\UuidFactory; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Generator\TimeGeneratorInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Builder\UuidBuilderInterface; class UuidFactoryTest extends TestCase { @@ -38,12 +44,12 @@ class UuidFactoryTest extends TestCase public function testGettersReturnValueFromFeatureSet() { - $codec = $this->getMockBuilder('Ramsey\Uuid\Codec\CodecInterface')->getMock(); - $nodeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); - $timeGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\TimeGeneratorInterface')->getMock(); + $codec = $this->getMockBuilder(CodecInterface::class)->getMock(); + $nodeProvider = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); + $timeGenerator = $this->getMockBuilder(TimeGeneratorInterface::class)->getMock(); - $featureSet = $this->getMockBuilder('Ramsey\Uuid\FeatureSet')->getMock(); + $featureSet = $this->getMockBuilder(FeatureSet::class)->getMock(); $featureSet->method('getCodec')->willReturn($codec); $featureSet->method('getNodeProvider')->willReturn($nodeProvider); $featureSet->method('getRandomGenerator')->willReturn($randomGenerator); @@ -79,19 +85,19 @@ class UuidFactoryTest extends TestCase { $uuidFactory = new UuidFactory(); - $codec = $this->getMockBuilder('Ramsey\Uuid\Codec\CodecInterface')->getMock(); + $codec = $this->getMockBuilder(CodecInterface::class)->getMock(); $uuidFactory->setCodec($codec); $this->assertEquals($codec, $uuidFactory->getCodec()); - $timeGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\TimeGeneratorInterface')->getMock(); + $timeGenerator = $this->getMockBuilder(TimeGeneratorInterface::class)->getMock(); $uuidFactory->setTimeGenerator($timeGenerator); $this->assertEquals($timeGenerator, $uuidFactory->getTimeGenerator()); - $numberConverter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $numberConverter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $uuidFactory->setNumberConverter($numberConverter); $this->assertEquals($numberConverter, $uuidFactory->getNumberConverter()); - $uuidBuilder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); + $uuidBuilder = $this->getMockBuilder(UuidBuilderInterface::class)->getMock(); $uuidFactory->setUuidBuilder($uuidBuilder); $this->assertEquals($uuidBuilder, $uuidFactory->getUuidBuilder()); } diff --git a/tests/UuidTest.php b/tests/UuidTest.php index 6ea5414..5304b78 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -4,10 +4,13 @@ namespace Ramsey\Uuid\Test; use Ramsey\Uuid\Codec\TimestampFirstCombCodec; use Ramsey\Uuid\Codec\TimestampLastCombCodec; +use Ramsey\Uuid\Converter\Number\DegradedNumberConverter; +use Ramsey\Uuid\DegradedUuid; use Ramsey\Uuid\FeatureSet; use Ramsey\Uuid\Provider\Time\FixedTimeProvider; use Ramsey\Uuid\Generator\CombGenerator; use Ramsey\Uuid\Generator\RandomGeneratorFactory; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidFactory; use stdClass; @@ -226,8 +229,8 @@ class UuidTest extends TestCase $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); - $this->assertInstanceOf('Ramsey\Uuid\DegradedUuid', $uuid); - $this->assertInstanceOf('Ramsey\Uuid\Converter\Number\DegradedNumberConverter', $uuid->getNumberConverter()); + $this->assertInstanceOf(DegradedUuid::class, $uuid); + $this->assertInstanceOf(DegradedNumberConverter::class, $uuid->getNumberConverter()); $date = $uuid->getDateTime(); } @@ -809,7 +812,7 @@ class UuidTest extends TestCase public function testUuid4() { $uuid = Uuid::uuid4(); - $this->assertInstanceOf('Ramsey\Uuid\Uuid', $uuid); + $this->assertInstanceOf(Uuid::class, $uuid); $this->assertEquals(2, $uuid->getVariant()); $this->assertEquals(4, $uuid->getVersion()); } @@ -820,7 +823,7 @@ class UuidTest extends TestCase */ public function testUuid4TimestampLastComb() { - $mock = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); + $mock = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); $mock->expects($this->any()) ->method('generate') ->willReturnCallback(function ($length) { @@ -852,7 +855,7 @@ class UuidTest extends TestCase */ public function testUuid4TimestampFirstComb() { - $mock = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); + $mock = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); $mock->expects($this->any()) ->method('generate') ->willReturnCallback(function ($length) { @@ -1444,8 +1447,8 @@ class UuidTest extends TestCase */ public function testUsingNilAsValidUuid() { - $this->assertInstanceOf('Ramsey\Uuid\Uuid', Uuid::uuid3(Uuid::NIL, 'randomtext')); - $this->assertInstanceOf('Ramsey\Uuid\Uuid', Uuid::uuid5(Uuid::NIL, 'randomtext')); + $this->assertInstanceOf(Uuid::class, Uuid::uuid3(Uuid::NIL, 'randomtext')); + $this->assertInstanceOf(Uuid::class, Uuid::uuid5(Uuid::NIL, 'randomtext')); } /**