Skip to content

Commit f77a7ad

Browse files
committed
added codepen test
1 parent f7997e8 commit f77a7ad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/CodepenTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
class CodepenTest extends PHPUnit_Framework_TestCase
3+
{
4+
public function testAnonymous()
5+
{
6+
$info = Embed\Embed::create('http://codepen.io/anon/pen/QwPVNW');
7+
8+
$this->assertEquals($info->imageWidth, 400);
9+
$this->assertEquals($info->imageHeight, 225);
10+
$this->assertEquals($info->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>');
11+
$this->assertEquals($info->type, 'rich');
12+
}
13+
14+
public function testNormal()
15+
{
16+
$info = Embed\Embed::create('http://codepen.io/Zhouzi/pen/JoRazP');
17+
18+
$this->assertEquals($info->title, 'TheaterJS');
19+
$this->assertEquals($info->imageWidth, 384);
20+
$this->assertEquals($info->imageHeight, 225);
21+
$this->assertEquals($info->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>');
22+
$this->assertEquals($info->type, 'rich');
23+
}
24+
}

0 commit comments

Comments
 (0)