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