/** * @dataProvider priceDataProvider */ public function testPriceFinder($currency, $country, $customerGroup, $channel, $result) { $price = PriceFinder::findPriceFor($this->getPrices(), $currency, $country, is_null($customerGroup) ? null : CustomerGroupReference::ofId($customerGroup), is_null($channel) ? null : ChannelReference::ofId($channel)); $this->assertSame($result, $price->getValue()->getCentAmount()); }
private function priceHasCustomerGroup(Price $price, CustomerGroupReference $customerGroup) { return !is_null($price->getCustomerGroup()) && $price->getCustomerGroup()->getId() == $customerGroup->getId(); }