/** * Forwarder to fDOMXPath's prepare method allowing for easy and secure * placeholder replacement comparable to sql's prepared statements * . * @param string $xpath String containing xpath with :placeholder markup * @param array $valueMap Array containing keys (:placeholder) and value pairs to be quoted * * @return string */ public function prepareQuery($xpath, array $valueMap) { if (is_null($this->xp)) { $this->getDOMXPath(); } return $this->xp->prepare($xpath, $valueMap); }
public function testPrepareReturnsUnmodifiedXPathOnEmptyArray() { $xpath = 'test'; $this->assertEquals($xpath, $this->xp->prepare($xpath, array())); }