diff --git a/composer.json b/composer.json index 81da625..c17c804 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": "^5.4 | ^7 | ^8", + "php": "^5.6 | ^7 | ^8", "ext-json": "*", "paragonie/random_compat": "^1 | ^2 | 9.99.99", "symfony/polyfill-ctype": "^1.8" @@ -35,7 +35,7 @@ "moontoast/math": "^1.1", "paragonie/random-lib": "^2", "php-mock/php-mock-phpunit": "^0.3 | ^1.1", - "phpunit/phpunit": "^4.8 | ^5.4 | ^6.5", + "phpunit/phpunit": "^5.4 | ^6.5", "squizlabs/php_codesniffer": "^3.5" }, "suggest": { diff --git a/tests/Builder/DefaultUuidBuilderTest.php b/tests/Builder/DefaultUuidBuilderTest.php index 125b497..e14c31e 100644 --- a/tests/Builder/DefaultUuidBuilderTest.php +++ b/tests/Builder/DefaultUuidBuilderTest.php @@ -4,6 +4,9 @@ namespace Ramsey\Uuid\Test\Builder; use PHPUnit_Framework_TestCase; use Ramsey\Uuid\Builder\DefaultUuidBuilder; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Uuid; /** * Class DefaultUuidBuilderTest @@ -15,9 +18,9 @@ class DefaultUuidBuilderTest extends PHPUnit_Framework_TestCase public function testBuildCreatesUuid() { - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $builder = new DefaultUuidBuilder($converter); - $codec = $this->getMockBuilder('Ramsey\Uuid\Codec\CodecInterface')->getMock(); + $codec = $this->getMockBuilder(CodecInterface::class)->getMock(); $fields = [ 'time_low' => '754cd475', @@ -29,6 +32,6 @@ class DefaultUuidBuilderTest extends PHPUnit_Framework_TestCase ]; $result = $builder->build($codec, $fields); - $this->assertInstanceOf('Ramsey\Uuid\Uuid', $result); + $this->assertInstanceOf(Uuid::class, $result); } } diff --git a/tests/Builder/DegradedUuidBuilderTest.php b/tests/Builder/DegradedUuidBuilderTest.php index ce017e2..2298648 100644 --- a/tests/Builder/DegradedUuidBuilderTest.php +++ b/tests/Builder/DegradedUuidBuilderTest.php @@ -4,6 +4,9 @@ namespace Ramsey\Uuid\Test\Builder; use PHPUnit_Framework_TestCase; use Ramsey\Uuid\Builder\DegradedUuidBuilder; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\DegradedUuid; /** * Class DegradedUuidBuilderTest @@ -15,9 +18,9 @@ class DegradedUuidBuilderTest extends PHPUnit_Framework_TestCase public function testBuildCreatesUuid() { - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $builder = new DegradedUuidBuilder($converter); - $codec = $this->getMockBuilder('Ramsey\Uuid\Codec\CodecInterface')->getMock(); + $codec = $this->getMockBuilder(CodecInterface::class)->getMock(); $fields = [ 'time_low' => '754cd475', @@ -29,6 +32,6 @@ class DegradedUuidBuilderTest extends PHPUnit_Framework_TestCase ]; $result = $builder->build($codec, $fields); - $this->assertInstanceOf('Ramsey\Uuid\DegradedUuid', $result); + $this->assertInstanceOf(DegradedUuid::class, $result); } } diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index da69cda..de00cb3 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -25,8 +25,8 @@ class GuidStringCodecTest 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' => '12345678', 'time_mid' => '1234', 'time_hi_and_version' => 'abcd', @@ -98,7 +98,7 @@ class GuidStringCodecTest extends TestCase $string = 'uuid:78563412-3412-cdab-abef-1234abcd4321'; $this->builder->expects($this->once()) ->method('build') - ->with($this->isInstanceOf('Ramsey\Uuid\Codec\GuidStringCodec'), $this->fields); + ->with($this->isInstanceOf(GuidStringCodec::class), $this->fields); $codec = new GuidStringCodec($this->builder); $codec->decode($string); } @@ -109,7 +109,7 @@ class GuidStringCodecTest extends TestCase $string = 'uuid:12345678-1234-abcd-abef-1234abcd4321'; $this->builder->expects($this->once()) ->method('build') - ->with($this->isInstanceOf('Ramsey\Uuid\Codec\GuidStringCodec'), $this->fields); + ->with($this->isInstanceOf(GuidStringCodec::class), $this->fields); $codec = new GuidStringCodec($this->builder); $codec->decode($string); } diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index d86f0fb..63dd842 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -27,8 +27,8 @@ class StringCodecTest 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' => '12345678', 'time_mid' => '1234', 'time_hi_and_version' => 'abcd', @@ -87,7 +87,7 @@ class StringCodecTest extends TestCase $string = 'uuid:12345678-1234-abcd-abef-1234abcd4321'; $this->builder->expects($this->once()) ->method('build') - ->with($this->isInstanceOf('Ramsey\Uuid\Codec\StringCodec'), $this->fields); + ->with($this->isInstanceOf(StringCodec::class), $this->fields); $codec = new StringCodec($this->builder); $codec->decode($string); } @@ -95,7 +95,7 @@ class StringCodecTest extends TestCase public function testDecodeThrowsExceptionOnInvalidUuid() { $string = 'invalid-uuid'; - $this->setExpectedException('\InvalidArgumentException'); + $this->setExpectedException(\InvalidArgumentException::class); $codec = new StringCodec($this->builder); $codec->decode($string); } diff --git a/tests/Encoder/TimestampFirstCombCodecTest.php b/tests/Encoder/TimestampFirstCombCodecTest.php index 248f6cb..7a263ae 100644 --- a/tests/Encoder/TimestampFirstCombCodecTest.php +++ b/tests/Encoder/TimestampFirstCombCodecTest.php @@ -2,9 +2,11 @@ namespace Ramsey\Uuid\Test\Encoder; use PHPUnit_Framework_MockObject_MockObject; +use Ramsey\Uuid\Builder\UuidBuilderInterface; use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Codec\TimestampFirstCombCodec; use Ramsey\Uuid\Test\TestCase; +use Ramsey\Uuid\UuidInterface; class TimestampFirstCombCodecTest extends TestCase { @@ -20,13 +22,13 @@ class TimestampFirstCombCodecTest extends TestCase protected function setUp() { - $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); + $this->builderMock = $this->getMockBuilder(UuidBuilderInterface::class)->getMock(); $this->codec = new TimestampFirstCombCodec($this->builderMock); } public function testEncoding() { - $uuidMock = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); + $uuidMock = $this->getMockBuilder(UuidInterface::class)->getMock(); $uuidMock->expects($this->any()) ->method('getFieldsHex') ->willReturn(['ff6f8cb0', 'c57d', '11e1', '9b', '21', '0800200c9a66']); @@ -37,7 +39,7 @@ class TimestampFirstCombCodecTest extends TestCase public function testBinaryEncoding() { - $uuidMock = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); + $uuidMock = $this->getMockBuilder(UuidInterface::class)->getMock(); $uuidMock->expects($this->any()) ->method('getFieldsHex') ->willReturn(['ff6f8cb0', 'c57d', '11e1', '9b', '21', '0800200c9a66']); diff --git a/tests/Encoder/TimestampLastCombCodecTest.php b/tests/Encoder/TimestampLastCombCodecTest.php index 266449b..43fcd18 100644 --- a/tests/Encoder/TimestampLastCombCodecTest.php +++ b/tests/Encoder/TimestampLastCombCodecTest.php @@ -2,9 +2,11 @@ namespace Ramsey\Uuid\Test\Encoder; use PHPUnit_Framework_MockObject_MockObject; +use Ramsey\Uuid\Builder\UuidBuilderInterface; use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Codec\TimestampLastCombCodec; use Ramsey\Uuid\Test\TestCase; +use Ramsey\Uuid\UuidInterface; class TimestampLastCombCodecTest extends TestCase { @@ -20,13 +22,13 @@ class TimestampLastCombCodecTest extends TestCase protected function setUp() { - $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); + $this->builderMock = $this->getMockBuilder(UuidBuilderInterface::class)->getMock(); $this->codec = new TimestampLastCombCodec($this->builderMock); } public function testEncoding() { - $uuidMock = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); + $uuidMock = $this->getMockBuilder(UuidInterface::class)->getMock(); $uuidMock->expects($this->any()) ->method('getFieldsHex') ->willReturn(['0800200c', '9a66', '11e1', '9b', '21', 'ff6f8cb0c57d']); @@ -37,7 +39,7 @@ class TimestampLastCombCodecTest extends TestCase public function testBinaryEncoding() { - $uuidMock = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); + $uuidMock = $this->getMockBuilder(UuidInterface::class)->getMock(); $uuidMock->expects($this->any()) ->method('getHex') ->willReturn('0800200c9a6611e19b21ff6f8cb0c57d'); diff --git a/tests/Generator/CombGeneratorTest.php b/tests/Generator/CombGeneratorTest.php index 28bbd55..d356671 100644 --- a/tests/Generator/CombGeneratorTest.php +++ b/tests/Generator/CombGeneratorTest.php @@ -2,7 +2,9 @@ namespace Ramsey\Uuid\Test\Generator; +use Ramsey\Uuid\Converter\NumberConverterInterface; use Ramsey\Uuid\Generator\CombGenerator; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; use Ramsey\Uuid\Test\TestCase; /** @@ -18,19 +20,19 @@ class CombGeneratorTest extends TestCase { $length = 10; $expectedLength = ($length - $this->timestampBytes); - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); $randomGenerator->expects($this->once()) ->method('generate') ->with($expectedLength); - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $generator = new CombGenerator($randomGenerator, $converter); $generator->generate($length); } public function testGenerateCalculatesPaddedHexStringFromCurrentTimestamp() { - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $converter->expects($this->once()) ->method('toHex') ->with($this->isType('string')); @@ -44,12 +46,12 @@ class CombGeneratorTest extends TestCase $hash = dechex(1234567891); $timeHash = dechex(1458147405); - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); $randomGenerator->method('generate') ->with(($length - $this->timestampBytes)) ->willReturn($hash); - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $converter->method('toHex') ->with($this->isType('string')) ->willReturn($timeHash); @@ -76,8 +78,8 @@ class CombGeneratorTest extends TestCase public function testGenerateWithLessThanTimestampBytesThrowsException($length) { $this->setExpectedException('InvalidArgumentException'); - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $generator = new CombGenerator($randomGenerator, $converter); $generator->generate($length); } @@ -88,8 +90,8 @@ class CombGeneratorTest extends TestCase public function testGenerateWithOddNumberOverTimestampBytesCausesError() { $this->setExpectedException('PHPUnit_Framework_Error'); - $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); - $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); + $randomGenerator = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock(); + $converter = $this->getMockBuilder(NumberConverterInterface::class)->getMock(); $generator = new CombGenerator($randomGenerator, $converter); $generator->generate(7); } diff --git a/tests/Generator/DefaultTimeGeneratorTest.php b/tests/Generator/DefaultTimeGeneratorTest.php index 3534297..2aebce6 100644 --- a/tests/Generator/DefaultTimeGeneratorTest.php +++ b/tests/Generator/DefaultTimeGeneratorTest.php @@ -2,6 +2,7 @@ namespace Ramsey\Uuid\Test\Generator; +use Ramsey\Uuid\BinaryUtils; use Ramsey\Uuid\Converter\TimeConverterInterface; use Ramsey\Uuid\Generator\DefaultTimeGenerator; use Ramsey\Uuid\Provider\NodeProviderInterface; @@ -31,9 +32,9 @@ class DefaultTimeGeneratorTest extends TestCase protected function setUp() { parent::setUp(); - $this->timeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\TimeProviderInterface')->getMock(); - $this->nodeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); - $this->timeConverter = $this->getMockBuilder('Ramsey\Uuid\Converter\TimeConverterInterface')->getMock(); + $this->timeProvider = $this->getMockBuilder(TimeProviderInterface::class)->getMock(); + $this->nodeProvider = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); + $this->timeConverter = $this->getMockBuilder(TimeConverterInterface::class)->getMock(); $this->currentTime = ["sec" => 1458733431, "usec" => 877449]; $this->calculatedTime = ["low" => "83cb98e0", "mid" => "98e0", "hi" => "03cb"]; } @@ -111,7 +112,7 @@ class DefaultTimeGeneratorTest extends TestCase $this->timeConverter->method('calculateTime') ->with($this->currentTime['sec'], $this->currentTime['usec']) ->willReturn($this->calculatedTime); - $binaryUtils = Mockery::mock('alias:Ramsey\Uuid\BinaryUtils'); + $binaryUtils = Mockery::mock('alias:'.BinaryUtils::class); $binaryUtils->shouldReceive('applyVersion') ->with($this->calculatedTime['hi'], 1) ->andReturn(971); @@ -136,7 +137,7 @@ class DefaultTimeGeneratorTest extends TestCase { $this->timeProvider->method('currentTime')->willReturn($this->currentTime); $this->timeConverter->method('calculateTime')->willReturn($this->calculatedTime); - $binaryUtils = Mockery::mock('alias:Ramsey\Uuid\BinaryUtils'); + $binaryUtils = Mockery::mock('alias:'.BinaryUtils::class); $binaryUtils->shouldReceive('applyVersion')->andReturn(971); $binaryUtils->shouldReceive('applyVariant')->andReturn(143); diff --git a/tests/Generator/RandomGeneratorFactoryTest.php b/tests/Generator/RandomGeneratorFactoryTest.php index 6293165..d00d768 100644 --- a/tests/Generator/RandomGeneratorFactoryTest.php +++ b/tests/Generator/RandomGeneratorFactoryTest.php @@ -2,6 +2,7 @@ namespace Ramsey\Uuid\Test\Generator; +use Ramsey\Uuid\Generator\RandomBytesGenerator; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Generator\RandomGeneratorFactory; @@ -11,6 +12,6 @@ class RandomGeneratorFactoryTest extends TestCase { $generator = RandomGeneratorFactory::getGenerator(); - $this->assertInstanceOf('Ramsey\\Uuid\\Generator\\RandomBytesGenerator', $generator); + $this->assertInstanceOf(RandomBytesGenerator::class, $generator); } } diff --git a/tests/Generator/RandomLibAdapterTest.php b/tests/Generator/RandomLibAdapterTest.php index 9e0da77..2ddac40 100644 --- a/tests/Generator/RandomLibAdapterTest.php +++ b/tests/Generator/RandomLibAdapterTest.php @@ -5,6 +5,8 @@ namespace Ramsey\Uuid\Test\Generator; use Ramsey\Uuid\Generator\RandomLibAdapter; use Ramsey\Uuid\Test\TestCase; use Mockery; +use RandomLib\Factory as RandomLibFactory; +use RandomLib\Generator; /** * Class RandomLibAdapterTest @@ -19,11 +21,11 @@ class RandomLibAdapterTest extends TestCase */ public function testAdapterWithGeneratorDoesNotCreateGenerator() { - $factory = Mockery::mock('overload:RandomLib\Factory'); + $factory = Mockery::mock('overload:' . RandomLibFactory::class); $factory->shouldNotReceive('getHighStrengthGenerator') ->getMock(); - $generator = $this->getMockBuilder('RandomLib\Generator') + $generator = $this->getMockBuilder(Generator::class) ->disableOriginalConstructor() ->getMock(); new RandomLibAdapter($generator); @@ -35,7 +37,7 @@ class RandomLibAdapterTest extends TestCase */ public function testAdapterWithoutGeneratorGreatesGenerator() { - $factory = Mockery::mock('overload:RandomLib\Factory'); + $factory = Mockery::mock('overload:' . RandomLibFactory::class); $factory->shouldReceive('getHighStrengthGenerator') ->once() ->getMock(); @@ -46,7 +48,7 @@ class RandomLibAdapterTest extends TestCase public function testGenerateUsesGenerator() { $length = 10; - $generator = $this->getMockBuilder('RandomLib\Generator') + $generator = $this->getMockBuilder(Generator::class) ->disableOriginalConstructor() ->getMock(); $generator->expects($this->once()) @@ -59,7 +61,7 @@ class RandomLibAdapterTest extends TestCase public function testGenerateReturnsString() { - $generator = $this->getMockBuilder('RandomLib\Generator') + $generator = $this->getMockBuilder(Generator::class) ->disableOriginalConstructor() ->getMock(); $generator->expects($this->once()) diff --git a/tests/Generator/SodiumRandomGeneratorTest.php b/tests/Generator/SodiumRandomGeneratorTest.php index 7716d6d..830d18c 100644 --- a/tests/Generator/SodiumRandomGeneratorTest.php +++ b/tests/Generator/SodiumRandomGeneratorTest.php @@ -42,7 +42,7 @@ class SodiumRandomGeneratorTest extends TestCase $uuid = Uuid::uuid4(); $this->assertInstanceOf( - 'Ramsey\Uuid\Generator\SodiumRandomGenerator', + SodiumRandomGenerator::class, $uuid->getFactory()->getRandomGenerator() ); } diff --git a/tests/Generator/TimeGeneratorFactoryTest.php b/tests/Generator/TimeGeneratorFactoryTest.php index 497ee3c..f5a5620 100644 --- a/tests/Generator/TimeGeneratorFactoryTest.php +++ b/tests/Generator/TimeGeneratorFactoryTest.php @@ -2,7 +2,11 @@ namespace Ramsey\Uuid\Test\Generator; +use Ramsey\Uuid\Converter\TimeConverterInterface; use Ramsey\Uuid\Generator\TimeGeneratorFactory; +use Ramsey\Uuid\Generator\TimeGeneratorInterface; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Provider\TimeProviderInterface; use Ramsey\Uuid\Test\TestCase; /** @@ -14,12 +18,12 @@ class TimeGeneratorFactoryTest extends TestCase { public function testGeneratorReturnsNewGenerator() { - $timeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\TimeProviderInterface')->getMock(); - $nodeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); - $timeConverter = $this->getMockBuilder('Ramsey\Uuid\Converter\TimeConverterInterface')->getMock(); + $timeProvider = $this->getMockBuilder(TimeProviderInterface::class)->getMock(); + $nodeProvider = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); + $timeConverter = $this->getMockBuilder(TimeConverterInterface::class)->getMock(); $factory = new TimeGeneratorFactory($nodeProvider, $timeConverter, $timeProvider); $generator = $factory->getGenerator(); - $this->assertInstanceOf('Ramsey\Uuid\Generator\TimeGeneratorInterface', $generator); + $this->assertInstanceOf(TimeGeneratorInterface::class, $generator); } } diff --git a/tests/Provider/Node/FallbackNodeProviderTest.php b/tests/Provider/Node/FallbackNodeProviderTest.php index ba302fe..5a60bf5 100644 --- a/tests/Provider/Node/FallbackNodeProviderTest.php +++ b/tests/Provider/Node/FallbackNodeProviderTest.php @@ -3,17 +3,18 @@ namespace Ramsey\Uuid\Test\Provider\Node; use Ramsey\Uuid\Provider\Node\FallbackNodeProvider; +use Ramsey\Uuid\Provider\NodeProviderInterface; use Ramsey\Uuid\Test\TestCase; class FallbackNodeProviderTest extends TestCase { public function testGetNodeCallsGetNodeOnEachProviderUntilNodeFound() { - $providerWithNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $providerWithNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $providerWithNode->expects($this->once()) ->method('getNode') ->willReturn('57764a07f756'); - $providerWithoutNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $providerWithoutNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $providerWithoutNode->expects($this->once()) ->method('getNode') ->willReturn(null); @@ -24,15 +25,15 @@ class FallbackNodeProviderTest extends TestCase public function testGetNodeReturnsNodeFromFirstProviderWithNode() { - $providerWithoutNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $providerWithoutNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $providerWithoutNode->expects($this->once()) ->method('getNode') ->willReturn(null); - $providerWithNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $providerWithNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $providerWithNode->expects($this->once()) ->method('getNode') ->willReturn('57764a07f756'); - $anotherProviderWithoutNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $anotherProviderWithoutNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $anotherProviderWithoutNode->expects($this->never()) ->method('getNode'); @@ -43,7 +44,7 @@ class FallbackNodeProviderTest extends TestCase public function testGetNodeReturnsNullWhenNoNodesFound() { - $providerWithoutNode = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); + $providerWithoutNode = $this->getMockBuilder(NodeProviderInterface::class)->getMock(); $providerWithoutNode->method('getNode') ->willReturn(null);