public function testRoot() { $root = (new Node('root'))->addChild((new Node('child'))->addChild($grandchild = new Node('grandchild'))); $this->assertSame($root, $grandchild->root()); }