/** * Perform an xpath query * * @param String $q query string containing xpath * @param \DOMNode|null $ctx (optional) Context DOMNode * @param boolean $registerNodeNS Register flag pass through * * @return \DOMNodeList */ public function query($q, \DOMNode $ctx = NULL, $registerNodeNS = TRUE) { if (is_null($this->xp)) { $this->getDOMXPath(); } return $this->xp->evaluate($q, $ctx, $registerNodeNS); }
/** * @covers TheSeer\fDOM\fDOMXPath::evaluate * @expectedException TheSeer\fDOM\fDOMException */ public function testExecutingAQueryWithEvaluateWithInvalidXPathThrowsException() { $this->xp->evaluate('//[invalid'); }