function it_returns_false_if_any_checker_disapproves_shipping_method($registry, RuleCheckerInterface $checker, ShippingSubjectInterface $subject, ShippingMethodInterface $shippingMethod, RuleInterface $rule)
 {
     $configuration = [];
     $rule->getType()->shouldBeCalled()->willReturn(RuleInterface::TYPE_ITEM_TOTAL);
     $rule->getConfiguration()->shouldBeCalled()->willReturn($configuration);
     $shippingMethod->getCategory()->shouldBeCalled();
     $shippingMethod->getRules()->shouldBeCalled()->willReturn([$rule]);
     $registry->get(RuleInterface::TYPE_ITEM_TOTAL)->shouldBeCalled()->willReturn($checker);
     $checker->isEligible($subject, $configuration)->shouldBeCalled()->willReturn(false);
     $this->isEligible($subject, $shippingMethod)->shouldReturn(false);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function removeRule(RuleInterface $rule)
 {
     $rule->setMethod(null);
     $this->rules->removeElement($rule);
 }