function it_also_sets_name_on_the_root_taxon(TaxonInterface $taxon) { $taxon->setName('Category')->shouldBeCalled(); $taxon->setTaxonomy($this)->shouldBeCalled(); $this->setRoot($taxon); $this->setName('Category'); }
function it_also_sets_translation_on_root_taxon(TaxonInterface $taxon, TaxonomyTranslation $translation) { $translation->getName()->willReturn('New'); $translation->getLocale()->shouldBeCalled(); $translation->setTranslatable($this)->shouldBeCalled(); $taxon->setName('New')->shouldBeCalled(); $taxon->setTaxonomy($this)->shouldBeCalled(); $taxon->setCurrentLocale(Argument::any())->shouldBeCalled(); $taxon->setFallbackLocale(Argument::any())->shouldBeCalled(); $this->setRoot($taxon); $this->addTranslation($translation); }
function it_allows_to_remove_child_taxons(TaxonomyInterface $taxonomy, TaxonInterface $taxon) { $this->setTaxonomy($taxonomy); $taxon->setTaxonomy($taxonomy)->shouldBeCalled(); $taxon->setParent($this)->shouldBeCalled(); $this->addChild($taxon); $taxon->setTaxonomy(null)->shouldBeCalled(); $taxon->setParent(null)->shouldBeCalled(); $this->removeChild($taxon); }
/** * {@inheritdoc} */ public function setRoot(TaxonInterface $root) { $root->setTaxonomy($this); $root->setCurrentLocale($this->getCurrentLocale()); $root->setFallbackLocale($this->getFallbackLocale()); $this->root = $root; }
/** * {@inheritdoc} */ public function setRoot(TaxonInterface $root) { $root->setTaxonomy($this); $this->root = $root; return $this; }