Sylius\Behat\Context\Setup\PromotionContext::thereIsPromotion PHP Method

thereIsPromotion() public method

public thereIsPromotion ( $promotionName, $promotionCode = null )
    public function thereIsPromotion($promotionName, $promotionCode = null)
    {
        $promotion = $this->testPromotionFactory->createForChannel($promotionName, $this->sharedStorage->get('channel'));
        if (null !== $promotionCode) {
            $promotion->setCode($promotionCode);
        }
        $this->promotionRepository->add($promotion);
        $this->sharedStorage->set('promotion', $promotion);
    }
PromotionContext