Skip to content

Commit fbce076

Browse files
committed
test repaired
1 parent 9eabef3 commit fbce076

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

tests/CodepenTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function testAnonymous()
99
[
1010
'imageWidth' => 400,
1111
'imageHeight' => 225,
12-
'code' => '<iframe id="cp_embed_QwPVNW" src="https://codepen.io/anon/embed/QwPVNW?height=300&amp;slug-hash=QwPVNW&amp;default-tab=result&amp;host=http%3A%2F%2Fcodepen.io" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
12+
'code' => '<iframe id="cp_embed_QwPVNW" src="https://codepen.io/anon/embed/preview/QwPVNW?height=300&amp;slug-hash=QwPVNW&amp;default-tab=result&amp;host=http%3A%2F%2Fcodepen.io" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
1313
'type' => 'rich',
1414
]
1515
);
@@ -23,7 +23,7 @@ public function testNormal()
2323
'title' => 'TheaterJS',
2424
'imageWidth' => 384,
2525
'imageHeight' => 225,
26-
'code' => '<iframe id="cp_embed_JoRazP" src="https://codepen.io/Zhouzi/embed/JoRazP?height=300&amp;slug-hash=JoRazP&amp;default-tab=result&amp;host=http%3A%2F%2Fcodepen.io" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
26+
'code' => '<iframe id="cp_embed_JoRazP" src="https://codepen.io/Zhouzi/embed/preview/JoRazP?height=300&amp;slug-hash=JoRazP&amp;default-tab=result&amp;host=http%3A%2F%2Fcodepen.io" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
2727
'type' => 'rich',
2828
]
2929
);

tests/ImageInfoTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class ImageInfoTest extends TestCaseBase
77
const TEST_IMAGE_HEIGHT = 408;
88
const TEST_IMAGE_SIZE = 244800;
99
const TEST_IMAGE_MIME = 'image/jpeg';
10+
const TEST_IMAGE_BASE64_URL = 'http://www.websiteoptimization.com/speed/tweak/inline-images/folder-test.html';
11+
const TEST_IMAGE_BASE64_IMAGE = 'data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7';
1012

1113
public function testCurl()
1214
{
@@ -39,4 +41,38 @@ public function testGuzzle()
3941
'value' => self::TEST_IMAGE_URL,
4042
]);
4143
}
44+
45+
public function testBase64Images()
46+
{
47+
$info = Embed\Embed::create(self::TEST_IMAGE_BASE64_URL, [
48+
'adapter' => [
49+
'config' => [
50+
'minImageWidth' => 0,
51+
'minImageHeight' => 0,
52+
]
53+
]
54+
]);
55+
56+
$this->assertEquals($info->image, self::TEST_IMAGE_BASE64_IMAGE);
57+
}
58+
59+
public function testBase64ImagesGuzzle()
60+
{
61+
$info = Embed\Embed::create(self::TEST_IMAGE_BASE64_URL, [
62+
'adapter' => [
63+
'config' => [
64+
'minImageWidth' => 0,
65+
'minImageHeight' => 0,
66+
]
67+
],
68+
'image' => [
69+
'class' => 'Embed\ImageInfo\Guzzle5',
70+
'config' => [
71+
'client' => new \GuzzleHttp\Client()
72+
]
73+
]
74+
]);
75+
76+
$this->assertEquals($info->image, self::TEST_IMAGE_BASE64_IMAGE);
77+
}
4278
}

tests/SoundcloudTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function testFour()
5151
$this->assertEmbed(
5252
'https://soundcloud.com/ididthat-1/lowe-ct-cape-times-world-cup',
5353
[
54-
'title' => 'LOWE CT Cape Times - World Cup by iDidThat.net',
55-
'description' => 'If you did it. Show it on ididthat.net',
54+
'title' => 'LOWE CT Cape Times - World Cup by iDidTht.com',
55+
'description' => 'If you did it. Show it on ididtht.com',
5656
'type' => 'rich',
5757
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F191904624&show_artwork=true"></iframe>',
5858
'providerName' => 'SoundCloud',

tests/ViddlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function testOne()
99
[
1010
'title' => 'Viddler Platform Overview',
1111
'type' => 'video',
12-
'code' => '<iframe width="620" height="349" src="http://viddler.com/embed/bdce8c7" frameborder="0" allowfullscreen></iframe>',
12+
'code' => '<iframe width="620" height="349" src="http://www.viddler.com/embed/bdce8c7" frameborder="0" allowfullscreen></iframe>',
1313
'providerName' => 'Viddler',
1414
'providerUrl' => 'http://viddler.com/',
1515
]

0 commit comments

Comments
 (0)