public function testGetAncestor() { $ancestor = $this->deepnode->getAncestor(0); $this->assertNotNull($ancestor); $this->assertTrue($this->rootNode->isSame($ancestor), 'depth 0 wrong'); $ancestor = $this->deepnode->getAncestor(1); $this->assertNotNull($ancestor); $this->assertTrue($this->node->isSame($ancestor), 'depth 1 wrong'); $ancestor = $this->deepnode->getAncestor(2); $this->assertNotNull($ancestor); $this->assertTrue($this->node->getNode('multiValueProperty')->isSame($ancestor), 'depth 2 wrong'); //self $ancestor = $this->deepnode->getAncestor($this->deepnode->getDepth()); $this->assertNotNull($ancestor); $this->assertTrue($this->deepnode->isSame($ancestor)); }
/** * {@inheritdoc} */ public function isSame(ItemInterface $otherItem) { return $this->node->isSame($otherItem); }