public function testLoadHtml() { $html = $this->loadFixture('testpage.html'); $document = new Document(); $document->loadHtml($html); $this->assertNotNull(count($document('div'))); $document->load($html); $this->assertNotNull(count($document('div'))); $document = Document::str_get_html($html); $this->assertNotNull(count($document('div'))); }
/** * @param $name * @param $arguments * * @return bool|Document */ public static function __callStatic($name, $arguments) { if ($name == 'str_get_html') { $document = new Document(); return $document->loadHtml($arguments[0]); } if ($name == 'file_get_html') { $document = new Document(); return $document->loadHtmlFile($arguments[0]); } throw new BadMethodCallException('Method does not exist'); }