toBeInstanceOf(WarningThresholdQuantity::class) ->and($threshold->value)->toBe($value); }); it('accepts a zero value, meaning no warning', function (): void { // WHEN $threshold = new WarningThresholdQuantity(0); // THEN expect($threshold->value)->toBe(0); }); it('rejects a negative value', function (): void { // WHEN $action = fn (): WarningThresholdQuantity => new WarningThresholdQuantity(-1); // THEN expect($action)->toThrow(\DomainException::class, 'Warning threshold quantity cannot be negative.'); }); });