3
3
4
4
class EmbedTest extends PHPUnit_Framework_TestCase
5
5
{
6
- private function checkUrl ($ url , array $ values )
6
+ private function checkUrl ($ url , array $ values, array $ options = null )
7
7
{
8
- $ info = Embed \Embed::create ($ url );
8
+ $ info = Embed \Embed::create ($ url, $ options );
9
9
10
10
foreach ($ values as $ name => $ value ) {
11
11
$ this ->assertEquals ($ value , $ info ->$ name );
@@ -52,22 +52,6 @@ public function testUrls()
52
52
)
53
53
);
54
54
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
-
71
55
$ this ->checkUrl (
72
56
'http://www.dailymotion.com/video/xy0wd_chats-paresseux ' ,
73
57
array (
@@ -83,6 +67,23 @@ public function testUrls()
83
67
'providerIcon ' => 'http://static1.dmcdn.net/images/apple-touch-icon.png.vcbf86c6fe83fbbe11 '
84
68
)
85
69
);
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>— 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>— 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
+ );
86
87
}
87
88
88
89
public function testUrlParser ()
0 commit comments