diff --git a/tests/Unit/Shared/DDD/EntityIdTest.php b/tests/Unit/Shared/DDD/EntityIdTest.php new file mode 100644 index 0000000..256d983 --- /dev/null +++ b/tests/Unit/Shared/DDD/EntityIdTest.php @@ -0,0 +1,36 @@ +value) + ->toBe($validUuid) + ->and((string) $entityId)->toBe($validUuid); + }); + + it('throws a DomainException when instantiated with an empty string', function (): void { + // GIVEN + $invalidUuid = ''; + + // WHEN & THEN + expect(fn () => new readonly class ($invalidUuid) extends EntityId + { + })->toThrow(\DomainException::class); + }); +});