public function testGetAncestorsAndSelf() { $root = new Node('r'); $root->addChild($a = new Node('a')); $a->addChild($b = new Node('b')); $this->assertEquals([$root, $a, $b], $b->getAncestorsAndSelf()); }