Esempio n. 1
0
 /**
  * @param PromotionInterface $promotion
  * @param int $discount
  * @param array $configuration
  */
 private function createItemFixedPromotion(PromotionInterface $promotion, $discount, array $configuration)
 {
     $this->persistPromotion($promotion, $this->actionFactory->createItemFixedDiscount($discount), $configuration);
 }
Esempio n. 2
0
 function it_creates_item_fixed_discount_action_for_promotion_products_priced_between(ActionFactoryInterface $actionFactory, ActionInterface $action, ObjectManager $objectManager, PromotionInterface $promotion)
 {
     $actionFactory->createItemFixedDiscount(1000)->willReturn($action);
     $action->getConfiguration()->willReturn([]);
     $action->setConfiguration(['filters' => ['price_range' => ['min' => 5000, 'max' => 10000]]])->shouldBeCalled();
     $promotion->addAction($action)->shouldBeCalled();
     $objectManager->flush()->shouldBeCalled();
     $this->thisPromotionGivesOffOnEveryProductPricedBetween($promotion, 1000, 5000, 10000);
 }