code)->toBe('E300') ->and($additive->label)->toBe('Acide ascorbique'); }); }); describe('Additive Value Object Domain Rules', function (): void { it('throws DomainException for invalid code format', function (): void { // GIVEN, WHEN & THEN expect(fn () => new Additive('300', 'Acide ascorbique')) ->toThrow(\DomainException::class, "Invalid additive code '300'"); }); it('throws DomainException for empty label', function (): void { // GIVEN, WHEN & THEN expect(fn () => new Additive('E300', ' ')) ->toThrow(\DomainException::class, "Invalid label for additive 'E300': must not be empty"); }); });