Skip to content

Commit a30a758

Browse files
committed
fixed outdated tests
1 parent 3db7310 commit a30a758

File tree

4 files changed

+12
-27
lines changed

4 files changed

+12
-27
lines changed

tests/ImagesBlacklistTest.php

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,46 @@ class ImagesBlacklistTest extends PHPUnit_Framework_TestCase
33
{
44
public function testPlainText()
55
{
6-
$info = Embed\Embed::create('http://www.lopinion.fr/24-mars-2015/cartes-chance-sont-epuisees-22609', [
6+
$info = Embed\Embed::create('https://github.com/oscarotero/Embed', [
77
'adapter' => [
88
'config' => [
99
'imagesBlacklist' => [
10-
'http://www.lopinion.fr/sites/nb.com/files/2015/01/logo-o-default_0.png?p',
10+
'https://avatars1.githubusercontent.com/u/377873?v=3&s=400',
1111
],
1212
],
13-
],
14-
'providers' => [
15-
'html' => [
16-
'maxImages' => 0,
17-
],
1813
]
1914
]);
2015

21-
$this->assertNull($info->image);
16+
$this->assertEquals('https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif', $info->image);
2217
}
2318

2419
public function testPlainUrlMatch()
2520
{
26-
$info = Embed\Embed::create('http://www.lopinion.fr/24-mars-2015/cartes-chance-sont-epuisees-22609', [
21+
$info = Embed\Embed::create('https://github.com/oscarotero/Embed', [
2722
'adapter' => [
2823
'config' => [
2924
'imagesBlacklist' => [
30-
'*/logo-o-default_0.png*',
25+
'*.githubusercontent.com*',
3126
],
3227
],
33-
],
34-
'providers' => [
35-
'html' => [
36-
'maxImages' => 0,
37-
],
3828
]
3929
]);
4030

41-
$this->assertNull($info->image);
31+
$this->assertEquals('https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif', $info->image);
4232
}
4333

4434
public function testAuthorizedImage()
4535
{
46-
$info = Embed\Embed::create('http://www.lopinion.fr/24-mars-2015/jeunes-restent-angle-mort-politiques-publiques-22607', [
36+
$info = Embed\Embed::create('https://github.com/oscarotero/Embed', [
4737
'adapter' => [
4838
'config' => [
4939
'imagesBlacklist' => [
50-
'*/logo-o-default_0.png*',
40+
'*/octocat-spinner-*',
5141
],
5242
],
53-
],
54-
'providers' => [
55-
'html' => [
56-
'maxImages' => 0,
57-
],
5843
]
5944
]);
6045

61-
$this->assertNotNull($info->image);
46+
$this->assertEquals('https://avatars1.githubusercontent.com/u/377873?v=3&s=400', $info->image);
6247
}
6348
}

tests/RedirectionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function testGoogleTranslate()
1111
public function testRdio()
1212
{
1313
$info1 = Embed\Embed::create('http://rd.io/x/Q1IjXC8s');
14-
$info2 = Embed\Embed::create('https://www.rdio.com/artist/Soundgarden/album/Superunknown/');
14+
$info2 = Embed\Embed::create('https://www.rdio.com/artist/Soundgarden/album/Superunknown/?utm_campaign=share&utm_medium=Album&utm_source=13&utm_content=224371');
1515
$this->assertEquals($info1->url, $info2->url);
1616
}
1717

tests/SoundcloudTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testTwo()
1919
$info = Embed\Embed::create('https://soundcloud.com/bruceneilmusic');
2020

2121
$this->assertEquals($info->title, "Bruce Neil");
22-
$this->assertEquals($info->description, "Bruce Neil from Wokingham is a self-taught singer/songwriter with a folk and blues sound, producing songs that tell stories about people. Recently having success winning a BBC Introducing competition and achieving air play nationally. He takes his musical inspiration and guitar-playing style from the likes of Passenger Mick Flannery and Tommy Emmanuel.");
22+
$this->assertEquals($info->description, "Bruce Neil from Wokingham is a singer/songwriter with a folk inspired sound, producing songs with heartfelt depth and lyrics that captivate the listener, taking them on an insightful and thought-provoking journey. As a winner of BBC Introducing, resulting in air play nationally, he has recently achieved widespread public attention following the video release of his percussive folk rendition of Guns N’ Roses track Paradise City. Not only did this go viral on social media, it was endorsed by the band themselves and has achieved recognition and air play from several US radio stations. He takes his musical inspiration and guitar-playing style from the likes of Passenger and Mick Flannery.");
2323
$this->assertEquals($info->type, 'rich');
2424
$this->assertEquals($info->code, '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F6538603&show_artwork=true"></iframe>');
2525
$this->assertEquals($info->providerName, 'SoundCloud');

tests/TwitterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public function testOmitScript()
1818
],
1919
]);
2020

21-
$this->assertEquals($info->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/status/436461658601713664">February 20, 2014</a></blockquote>'."\n");
21+
$this->assertEquals($info->code, '<blockquote class="twitter-tweet"><p lang="es" dir="ltr">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/status/436461658601713664">February 20, 2014</a></blockquote>'."\n");
2222
}
2323
}

0 commit comments

Comments
 (0)