diff --git a/Tests/UuidTest.php b/Tests/UuidTest.php index 5e05b89..cb7ac10 100644 --- a/Tests/UuidTest.php +++ b/Tests/UuidTest.php @@ -95,6 +95,15 @@ public function testV1() $this->assertSame('3499710062d0', $uuid->getNode()); } + public function testV1IsLowerCase() + { + $uuid = new UuidV1(); + $this->assertSame(strtolower((string) $uuid), (string) $uuid); + + $uuid = new UuidV1('D9E7A184-5D5B-11EA-A62A-3499710062D0'); + $this->assertSame(strtolower((string) $uuid), (string) $uuid); + } + public function testV3() { $uuid = Uuid::v3(new UuidV4(self::A_UUID_V4), 'the name'); diff --git a/UuidV1.php b/UuidV1.php index 1ec0041..1e68737 100644 --- a/UuidV1.php +++ b/UuidV1.php @@ -25,7 +25,7 @@ class UuidV1 extends Uuid implements TimeBasedUidInterface public function __construct(?string $uuid = null) { if (null === $uuid) { - $this->uid = uuid_create(static::TYPE); + $this->uid = strtolower(uuid_create(static::TYPE)); } else { parent::__construct($uuid, true); }