/** * Forward to DOMXPath->registerPHPFunctions() * * @param mixed $restrict Array of function names or string with functionname to restrict callabilty to * * @throws fDOMException * * @return void */ public function registerPHPFunctions($restrict = NULL) { if (is_null($this->xp)) { $this->getDOMXPath(); } $this->xp->registerPHPFunctions($restrict); if (libxml_get_last_error()) { throw new fDOMException("Registering php functions failed.", fDOMException::RegistrationFailed); } }
public function testQueryOneReturnsValueOnNonNodeQuery() { $this->assertEquals('1', $this->xp->queryOne('count(//root)')); }