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