/**
  * Test cart with stackable coupon and all stacked coupons are stackable
  *
  * @covers checkStackableCoupon
  *
  * @dataProvider dataCheckStackableCoupon
  */
 public function testCheckStackableCoupon($couponStackable, $stackables, $expectsException)
 {
     $cart = $this->prophesize('Elcodi\\Component\\Cart\\Entity\\Interfaces\\CartInterface')->reveal();
     $coupon = $this->prophesize('Elcodi\\Component\\Coupon\\Entity\\Interfaces\\CouponInterface');
     $coupon->getStackable()->willReturn($couponStackable);
     $cartCouponRepository = $this->prophesize('Elcodi\\Component\\CartCoupon\\Repository\\CartCouponRepository');
     $cartCouponRepository->findBy(['cart' => $cart])->willReturn($this->getCartCouponsArray($stackables));
     $stackableCouponChecker = new StackableCouponChecker($cartCouponRepository->reveal());
     try {
         $stackableCouponChecker->checkStackableCoupon($cart, $coupon->reveal());
     } catch (CouponNotStackableException $exception) {
         if (!$expectsException) {
             throw $exception;
         }
     }
 }
 /**
  * Check if this coupon can be applied when other coupons had previously
  * been applied
  *
  * @param CartCouponOnApplyEvent $event Event
  *
  * @return null
  *
  * @throws CouponNotStackableException
  */
 public function checkStackableCoupon(CartCouponOnApplyEvent $event)
 {
     $this->stackableCouponChecker->checkStackableCoupon($event->getCart(), $event->getCoupon());
 }