diff --git a/tests/ExpectedBehaviorTest.php b/tests/ExpectedBehaviorTest.php index a9cf02e..9a181c5 100644 --- a/tests/ExpectedBehaviorTest.php +++ b/tests/ExpectedBehaviorTest.php @@ -363,6 +363,9 @@ class ExpectedBehaviorTest extends TestCase 'uuid3' => $uuid, 'uuid4' => $uuid, 'uuid5' => $uuid, + 'uuid6' => $uuid, + 'uuid7' => $uuid, + 'uuid8' => $uuid, 'fromBytes' => $uuid, 'fromString' => $uuid, 'fromInteger' => $uuid, @@ -377,6 +380,9 @@ class ExpectedBehaviorTest extends TestCase $this->assertSame($uuid, Uuid::uuid3(Uuid::NAMESPACE_URL, 'https://example.com/foo')); $this->assertSame($uuid, Uuid::uuid4()); $this->assertSame($uuid, Uuid::uuid5(Uuid::NAMESPACE_URL, 'https://example.com/foo')); + $this->assertSame($uuid, Uuid::uuid6()); + $this->assertSame($uuid, Uuid::uuid7()); + $this->assertSame($uuid, Uuid::uuid8(hex2bin('ffffffffffffffffffffffffffffffff'))); $this->assertSame($uuid, Uuid::fromBytes($bytes)); $this->assertSame($uuid, Uuid::fromString('ffffffff-ffff-ffff-ffff-ffffffffffff')); $this->assertSame($uuid, Uuid::fromInteger('340282366920938463463374607431768211455')); diff --git a/tests/UuidTest.php b/tests/UuidTest.php index ba60f32..f83e163 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -10,7 +10,6 @@ use Brick\Math\RoundingMode; use DateTimeImmutable; use DateTimeInterface; use Mockery; -use Mockery\MockInterface; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Ramsey\Uuid\Codec\StringCodec; @@ -673,19 +672,6 @@ class UuidTest extends TestCase $this->assertSame(Version::UnixTime, $uuid->getFields()->getVersion()); } - public function testUuid7ThrowsExceptionForUnsupportedFactory(): void - { - /** @var UuidFactoryInterface&MockInterface $factory */ - $factory = Mockery::mock(UuidFactoryInterface::class); - - Uuid::setFactory($factory); - - $this->expectException(UnsupportedOperationException::class); - $this->expectExceptionMessage('The provided factory does not support the uuid7() method'); - - Uuid::uuid7(); - } - public function testUuid7WithDateTime(): void { $dateTime = new DateTimeImmutable('@281474976710.655'); @@ -776,20 +762,6 @@ class UuidTest extends TestCase $this->assertSame(Version::Custom, $uuid->getFields()->getVersion()); } - public function testUuid8ThrowsExceptionForUnsupportedFactory(): void - { - /** @var UuidFactoryInterface&MockInterface $factory */ - $factory = Mockery::mock(UuidFactoryInterface::class); - - Uuid::setFactory($factory); - - $this->expectException(UnsupportedOperationException::class); - $this->expectExceptionMessage('The provided factory does not support the uuid8() method'); - - /** @phpstan-ignore staticMethod.resultUnused */ - Uuid::uuid8("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"); - } - /** * Tests known version-3 UUIDs *