/** * @param string CSS selector * @param array * * @return NodeList */ public function findByRule($selector, $rules, $wrapElement = true) { $segments = $selector !== null ? Query::getSegments($selector) : []; $xpath = Query::buildXpath(array_merge($segments, $rules)); return $this->xpath($xpath, $wrapElement); }
/** * @expectedException InvalidArgumentException */ public function testBuildXpathWithEmptyArray() { Query::buildXpath([]); }