Skip to content

Commit 244e9c0

Browse files
committed
fixed tests
1 parent bff2263 commit 244e9c0

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

tests/EmbedTest.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
class EmbedTest extends PHPUnit_Framework_TestCase
55
{
6-
private function checkUrl($url, array $values)
6+
private function checkUrl($url, array $values, array $options = null)
77
{
8-
$info = Embed\Embed::create($url);
8+
$info = Embed\Embed::create($url, $options);
99

1010
foreach ($values as $name => $value) {
1111
$this->assertEquals($value, $info->$name);
@@ -52,22 +52,6 @@ public function testUrls()
5252
)
5353
);
5454

55-
$this->checkUrl(
56-
'http://www.usatoday.com/story/tech/2013/07/19/microsoft-stock-plummets-12/2569413/',
57-
array(
58-
'title' => 'Microsoft stock plummets 11%',
59-
'description' => 'Investors grow skittish over PC prospects.',
60-
'image' => 'http://www.gannett-cdn.com/-mm-/fe06d222bdd27d15d6ac2b2c11dd7a17f46ceda0/c=141-0-3330-2406&r=x117&c=155x114/local/-/media/USATODAY/GenericImages/2013/07/18/1374181578000-B01-MONEYLINE-BALLMER-12-56733869.JPG',
61-
'imageWidth' => 155,
62-
'imageHeight' => 114,
63-
'url' => 'http://www.usatoday.com/story/tech/2013/07/19/microsoft-stock-plummets-12/2569413/',
64-
'type' => 'link',
65-
'providerName' => 'usatoday',
66-
'providerUrl' => 'http://usatoday.com',
67-
'providerIcon' => 'http://www.gannett-cdn.com/sites/usatoday/images/favicon.png'
68-
)
69-
);
70-
7155
$this->checkUrl(
7256
'http://www.dailymotion.com/video/xy0wd_chats-paresseux',
7357
array(
@@ -83,6 +67,23 @@ public function testUrls()
8367
'providerIcon' => 'http://static1.dmcdn.net/images/apple-touch-icon.png.vcbf86c6fe83fbbe11'
8468
)
8569
);
70+
71+
$this->checkUrl(
72+
'https://twitter.com/pepephone/status/436461658601713664',
73+
array(
74+
'code' => '<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/PabloHerreros">@PabloHerreros</a> Pepephone rompe la baraja - <a href="http://t.co/mFn7mcB1vy">http://t.co/mFn7mcB1vy</a></p>&mdash; pepephone (@pepephone) <a href="https://twitter.com/pepephone/statuses/436461658601713664">February 20, 2014</a></blockquote>'."\n".'<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'
75+
)
76+
);
77+
78+
$this->checkUrl(
79+
'https://twitter.com/pepephone/status/436461658601713664',
80+
array(
81+
'code' => '<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/PabloHerreros">@PabloHerreros</a> Pepephone rompe la baraja - <a href="http://t.co/mFn7mcB1vy">http://t.co/mFn7mcB1vy</a></p>&mdash; pepephone (@pepephone) <a href="https://twitter.com/pepephone/statuses/436461658601713664">February 20, 2014</a></blockquote>'
82+
),
83+
array(
84+
'oembedParameters' => array('omit_script' => true)
85+
)
86+
);
8687
}
8788

8889
public function testUrlParser()

0 commit comments

Comments
 (0)