forked from scottmac/opengraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenGraphTest.php
31 lines (27 loc) · 865 Bytes
/
OpenGraphTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require 'OpenGraph.php';
class OpenGraphTest extends PHPUnit_Framework_TestCase
{
public function testFetch()
{
$o = OpenGraph::fetch(
'http://www.rottentomatoes.com/m/10011268-oceans/'
);
$this->assertType('OpenGraph', $o);
$this->assertAttributeEquals(
array(
'title' => 'Oceans',
'type' => 'movie',
'image' => 'http://images.rottentomatoes.com/images/movie/custom/68/10011268.jpg',
'url' => 'http://www.rottentomatoes.com/m/10011268-oceans/',
'site_name' => 'Rotten Tomatoes',
),
'_values',
$o
);
}
public function testFetchReturnsFalseForWebsiteWithNoOpenGraphMetadata()
{
$this->assertEquals(FALSE, OpenGraph::fetch('http://www.example.org/'));
}
}