toBeInstanceOf(RequestedCouponQuantity::class) ->and($quantity->value)->toBe($value); }); it('rejects a quantity of zero', function () use ($zeroValue): void { // GIVEN / WHEN $action = fn (): RequestedCouponQuantity => new RequestedCouponQuantity($zeroValue); // THEN expect($action)->toThrow(\DomainException::class, 'Quantity should be more than 0.'); }); it('rejects a negative quantity', function () use ($negativeValue): void { // GIVEN / WHEN $action = fn (): RequestedCouponQuantity => new RequestedCouponQuantity($negativeValue); // THEN expect($action)->toThrow(\DomainException::class, 'Quantity should be more than 0.'); }); });