OGPからタイトル情報が取れない場合はtitleタグから取得を試みる (#65)

refs #62
This commit is contained in:
shibafu authored and GitHub committed 2019-01-23 00:04:10 +09:00
1 parent 648e171a57
commit 895e9f4b15
2 files changed
+16

No files matched your search

@@ -25,4 +25,14 @@ class OGPResolverTest extends TestCase
$this->assertEquals('The Open Graph protocol enables any web page to become a rich object in a social graph.', $metadata->description);
$this->assertEquals('http://ogp.me/logo.png', $metadata->image);
}
public function testResolveTitleOnly()
{
$resolver = new OGPResolver();
$metadata = $resolver->resolve('http://example.com');
$this->assertEquals('Example Domain', $metadata->title);
$this->assertEmpty($metadata->description);
$this->assertEmpty($metadata->image);
}
}