예제 #1
0
 /**
  * @Given /^(that channel) allows to shop using the "([^"]+)" locale$/
  * @Given /^(that channel) allows to shop using "([^"]+)" and "([^"]+)" locales$/
  * @Given /^(that channel) allows to shop using "([^"]+)", "([^"]+)" and "([^"]+)" locales$/
  */
 public function thatChannelAllowsToShopUsingAndLocales(ChannelInterface $channel, $firstLocaleName, $secondLocaleName = null, $thirdLocaleName = null)
 {
     $locales = new ArrayCollection();
     foreach ([$firstLocaleName, $secondLocaleName, $thirdLocaleName] as $localeName) {
         if (null === $localeName) {
             break;
         }
         $locales[] = $this->provideLocale($this->localeConverter->convertNameToCode($localeName));
     }
     $channel->setLocales($locales);
     $this->channelManager->flush();
 }