root = pQuery::parseStr('

italicprevious textnext textbolded

'); } function testItDeepSplitsDOMTreeByElement() { DOMUtil::splitOn($this->root, $this->root->query('a')->offsetGet(0)); expect($this->root->html())->equals( '

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); } }