function it_returns_the_lowest_price_if_more_than_1_group_provided_in_context(PriceableInterface $priceable, CustomerGroupInterface $group1, CustomerGroupInterface $group2)
 {
     $configuration = [42 => 4999, 17 => 4599, 95 => 4400];
     $context = ['groups' => [$group1, $group2]];
     $group1->getId()->shouldBeCalled()->willReturn(17);
     $group2->getId()->shouldBeCalled()->willReturn(95);
     $this->calculate($priceable, $configuration, $context)->shouldReturn(4400);
 }
 /**
  * @Then /^(this customer group) should still be named "([^"]+)"$/
  */
 public function thisChannelNameShouldBe(CustomerGroupInterface $customerGroup, $customerGroupName)
 {
     $this->iWantToBrowseCustomerGroupsOfTheStore();
     Assert::true($this->indexPage->isSingleResourceOnPage(['name' => $customerGroup->getName()]), sprintf('Customer group name %s has not been assigned properly.', $customerGroupName));
 }
 /**
  * @Then /^(this customer group) should no longer exist in the registry$/
  */
 public function thisCustomerGroupShouldNoLongerExistInTheRegistry(CustomerGroupInterface $customerGroup)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['name' => $customerGroup->getName()]), sprintf('Customer group %s should no longer exist in the registry', $customerGroup->getName()));
 }
示例#4
0
 /**
  * @Given /^([^"]+) gives ("[^"]+%") off the order for customers from ("[^"]*" group)$/
  */
 public function thePromotionGivesOffTheOrderForCustomersFromGroup(PromotionInterface $promotion, $discount, CustomerGroupInterface $customerGroup)
 {
     $rule = $this->ruleFactory->createNew();
     $rule->setType(CustomerGroupRuleChecker::TYPE);
     $rule->setConfiguration(['group_code' => $customerGroup->getCode()]);
     $this->createPercentagePromotion($promotion, $discount, [], $rule);
 }