/** * @Given /^(it) (belongs to "[^"]+")$/ */ public function itBelongsTo(ProductInterface $product, TaxonInterface $taxon) { $product->addTaxon($taxon); $this->objectManager->flush($product); }
/** * @param ProductInterface $product * @param array $options */ private function createRelations(ProductInterface $product, array $options) { foreach ($options['taxons'] as $taxon) { $product->addTaxon($taxon); } foreach ($options['channels'] as $channel) { $product->addChannel($channel); } foreach ($options['product_options'] as $option) { $product->addOption($option); } foreach ($options['product_attributes'] as $attribute) { $product->addAttribute($attribute); } }
function it_adds_taxon_to_product(ProductInterface $product, TaxonInterface $taxon) { $product->addTaxon($taxon)->shouldBeCalled(); $this->itBelongsTo($product, $taxon); }