/**
  * Given a coupon code, removes it from cart.
  *
  * @param CartInterface $cart       Cart
  * @param string        $couponCode Coupon code
  *
  * @return bool Coupon has been removed from cart
  */
 public function removeCouponByCode(CartInterface $cart, $couponCode)
 {
     $coupon = $this->couponRepository->findOneBy(['code' => $couponCode]);
     if (!$coupon instanceof CouponInterface) {
         return false;
     }
     return $this->removeCoupon($cart, $coupon);
 }
 /**
  * Create new CartCouponManager instance
  *
  * @return CartCouponManager
  */
 private function createCartCouponManagerInstance()
 {
     return new CartCouponManager($this->cartCouponEventDispatcher->reveal(), $this->couponRepository->reveal(), $this->cartCouponDirector->reveal(), $this->cartCouponRepository->reveal());
 }