public function testExtractTitle()
 {
     $crawler = new Crawler($this->getHtmlContent());
     $adapter = new Adapters\DefaultAdapter();
     $title = $adapter->extractTitle($crawler);
     $this->assertEquals('Default title', $title);
 }
示例#2
0
 public function extractTitle(Crawler $crawler)
 {
     $ret = $this->getElementText($crawler, $this->titleSelector);
     if (empty($ret) === true) {
         $ret = $this->fallbackAdapter->extractTitle($crawler);
     }
     return $ret;
 }