public function extractAuthor(Crawler $crawler) { $ret = $this->getElementText($crawler, $this->authorSelector); if (empty($ret) === true) { $ret = $this->fallbackAdapter->extractAuthor($crawler); } return $ret; }
public function testExtractAuthor() { $crawler = new Crawler($this->getHtmlContent()); $adapter = new Adapters\DefaultAdapter(); $author = $adapter->extractAuthor($crawler); $this->assertEquals('Mr. HTML', $author); }