/** * @Given /^(that channel) allows to shop using the "([^"]+)" currency$/ * @Given /^(that channel) allows to shop using "([^"]+)" and "([^"]+)" currencies$/ * @Given /^(that channel) allows to shop using "([^"]+)", "([^"]+)" and "([^"]+)" currencies$/ */ public function thatChannelAllowsToShopUsingAndCurrencies(ChannelInterface $channel, $firstCurrencyCode, $secondCurrencyCode = null, $thirdCurrencyCode = null) { $currencies = new ArrayCollection(); foreach ([$firstCurrencyCode, $secondCurrencyCode, $thirdCurrencyCode] as $currencyCode) { if (null === $currencyCode) { break; } $currencies[] = $this->provideCurrency($currencyCode); } $channel->setCurrencies($currencies); $this->channelManager->flush(); }