예제 #1
0
 function it_returns_an_array_of_with_a_single_parent_taxon(TaxonInterface $parentTaxon)
 {
     $parentTaxon->getParent()->willReturn(null);
     $parentTaxon->addChild($this)->shouldBeCalled();
     $this->setParent($parentTaxon);
     $this->getParents()->shouldReturn([$parentTaxon]);
 }
예제 #2
0
파일: Taxon.php 프로젝트: loic425/Sylius
 /**
  * {@inheritdoc}
  */
 public function setParent(TaxonInterface $parent = null)
 {
     $this->parent = $parent;
     if (null !== $parent) {
         $parent->addChild($this);
     }
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function addTaxon(TaxonInterface $taxon)
 {
     $this->root->addChild($taxon);
 }