/** * @Then /^(this coupon) should still exist in the registry$/ */ public function couponShouldStillExistInTheRegistry(PromotionCouponInterface $coupon) { Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $coupon->getCode()]), sprintf('Coupon with code %s should exist.', $coupon->getCode())); }
function it_returns_true_if_promotion_coupon_has_no_per_customer_usage_limit(OrderInterface $promotionSubject, CorePromotionCouponInterface $promotionCoupon) { $promotionCoupon->getPerCustomerUsageLimit()->willReturn(null); $this->isEligible($promotionSubject, $promotionCoupon)->shouldReturn(true); }
/** * @Given /^the (coupon "[^"]+") was used up to its usage limit$/ */ public function theCouponWasUsed(PromotionCouponInterface $coupon) { $coupon->setUsed($coupon->getUsageLimit()); $this->objectManager->flush(); }