Example #1
0
 function it_creates_new_taxonomy_with_root(TaxonInterface $taxon, TaxonomyInterface $taxonomy, FactoryInterface $taxonFactory, TranslatableFactoryInterface $translatableFactory)
 {
     $taxonFactory->createNew()->shouldBeCalled()->willReturn($taxon);
     $translatableFactory->createNew()->shouldBeCalled()->willReturn($taxonomy);
     $taxonomy->setRoot($taxon)->shouldBeCalled();
     $this->createNew()->shouldReturn($taxonomy);
 }
Example #2
0
 function it_creates_new_product_with_variant(ProductInterface $product, VariantInterface $variant, FactoryInterface $variantFactory, TranslatableFactoryInterface $translatableFactory)
 {
     $variantFactory->createNew()->shouldBeCalled()->willReturn($variant);
     $variant->setMaster(true)->shouldBeCalled();
     $translatableFactory->createNew()->shouldBeCalled()->willReturn($product);
     $product->setMasterVariant($variant)->shouldBeCalled();
     $this->createNew()->shouldReturn($product);
 }