public function testHFeed() { $html = file_get_contents($this->dir . '/HTML/h-feed.html'); $parser = new Parser(); $auth = new Authorship(); $microformats = $parser->getMicroformats($html, null); $expected = ['type' => ['h-card'], 'properties' => ['name' => ['Joe Bloggs']]]; $this->assertEquals($expected, $auth->findAuthor($microformats)); }
public function testLikeContent() { $html = file_get_contents($this->dir . '/HTML/testLikeContent.html'); $parser = new Parser(); $microformats = $parser->getMicroformats($html, null); $expected = ['name' => 'Joe Bloggs', 'url' => 'http://joebloggs.com/', 'photo' => 'http://joebloggs.com/photo.png']; $this->assertEquals($expected, $parser->likeContent($microformats)); }