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