code)->toBe(1) ->and($allergen->label)->toBe('Gluten'); }); }); describe('Allergen Value Object Domain Rules', function (): void { it('throws DomainException for code <= 0', function (): void { // GIVEN, WHEN & THEN expect(fn () => new Allergen(0, 'Gluten')) ->toThrow(\DomainException::class, "Invalid code '0' shall be greater than 0"); }); it('throws DomainException for empty label', function (): void { // GIVEN, WHEN & THEN expect(fn () => new Allergen(1, ' ')) ->toThrow(\DomainException::class, "Invalid label ' ' should not be empty"); }); });