public function testGetHeight() { $root = new Node(); $root->addChild($child1 = new Node('child1'))->addChild($child2 = new Node('child2'))->addChild($child3 = new Node('child3')); $child3->addChild(new Node("a"))->addChild(new Node("b")); $this->assertEquals(0, $child1->getHeight()); $this->assertEquals(2, $root->getHeight()); $this->assertEquals(1, $child3->getHeight()); }