コード例 #1
0
ファイル: Reader.php プロジェクト: spiderling-php/crawler
 /**
  * @param  string $id
  * @throws InvalidArgumentException when id not found
  * @return boolean
  */
 public function isVisible($id)
 {
     $element = $this->getElement($id);
     $conditions = ["contains(@style, 'display:none')", "contains(@style, 'display: none')", "self::script", "self::head"];
     $hidden = $this->xpath->query('./ancestor-or-self::*[' . join(' or ', $conditions) . ']', $element);
     return $hidden->length == 0;
 }
コード例 #2
0
 /**
  * @covers ::query
  * @covers ::onQueryError
  */
 public function testQueryInvalidScope()
 {
     $xpath = new SafeXPath($this->document);
     $this->setExpectedException('InvalidArgumentException', 'Node From Wrong Document');
     $xpath->query('//form', new DOMElement('div'));
 }