diff --git a/src/Shared/Helpers/UuidHelper.php b/src/Shared/Helpers/UuidHelper.php index 2a5cb4c..839cf5e 100644 --- a/src/Shared/Helpers/UuidHelper.php +++ b/src/Shared/Helpers/UuidHelper.php @@ -11,7 +11,7 @@ final readonly class UuidHelper { private function __construct() { - // Static class + throw new \LogicException('Static class'); } public static function isV4(UuidInterface $uuid): bool diff --git a/tests/Integration/Shared/Helpers/UuidHelperTest.php b/tests/Integration/Shared/Helpers/UuidHelperTest.php new file mode 100644 index 0000000..0170d78 --- /dev/null +++ b/tests/Integration/Shared/Helpers/UuidHelperTest.php @@ -0,0 +1,46 @@ +toBeTrue(); + }); + + it('can verify an UUID is v7', function (): void { + // GIVEN + $uuidV7 = Uuid::uuid7(); + + // WHEN + $result = UuidHelper::isV7($uuidV7); + + // THEN + expect($result)->toBeTrue(); + }); + + it('can get the version of an UUID', function (): void { + // GIVEN + $uuidV4 = Uuid::uuid4(); + $uuidV7 = Uuid::uuid7(); + + // WHEN + $resultV4 = UuidHelper::version($uuidV4); + $resultV7 = UuidHelper::version($uuidV7); + + // THEN + expect($resultV4)->toBe(4) + ->and($resultV7)->toBe(7); + }); +});