root = pQuery::parseStr('
italicprevious textnext textbolded
italicprevious text
'. 'next textbolded
' ); } function testItFindsTopAncestor() { $image = $this->root->query('img')->offsetGet(0); $paragraph = $this->root->query('p')->offsetGet(0); expect(DOMUtil::findTopAncestor($image))->equals($paragraph); } }