示例#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);
 }