/** * @Given /^there is product "([^"]+)" available in ((?:this|that|"[^"]+") channel)$/ */ public function thereIsProductAvailableInGivenChannel($productName, ChannelInterface $channel) { /** @var ProductInterface $product */ $product = $this->productFactory->createNew(); $product->setName($productName); $product->setPrice(0); $product->setDescription('Awesome ' . $productName); $product->addChannel($channel); $this->productRepository->add($product); }
/** * @param ProductInterface $product */ private function saveProduct(ProductInterface $product) { $this->productRepository->add($product); $this->sharedStorage->set('product', $product); }