public function testLastChild()
 {
     $parent = new Node();
     $child = new Node();
     $child2 = new Node();
     $child3 = new Node();
     $parent->addChild($child);
     $parent->addChild($child2);
     $parent->addChild($child3);
     $this->assertEquals($child3->id(), $parent->lastChild()->id());
 }
Example #2
0
 public function testGetGreatAncestor()
 {
     $parent = new Node();
     $child = new Node();
     $child2 = new Node();
     $parent->addChild($child);
     $child->addChild($child2);
     $ancestor = $child2->getAncestor($parent->id());
     $this->assertEquals($parent->id(), $ancestor->id());
 }