-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jiri Travnicek
committed
Sep 28, 2015
1 parent
5d68248
commit 8bb6907
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
use Northys\CSSInliner\CSSInliner; | ||
|
||
/** | ||
* Class CSSInlinerTest | ||
* | ||
* @package Tests | ||
*/ | ||
class CSSInlinerTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* Test Component | ||
*/ | ||
public function testComponent() | ||
{ | ||
$inliner = new CSSInliner; | ||
$inliner->addCSS(__DIR__ . '/test.css'); | ||
$output = $inliner->render(file_get_contents('test.html'), true); | ||
$expected = <<<EXPECTED | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> | ||
<html><body><h1 style="color: #27ae60; font-size: 200px; margin: 10px 50px 80px 30px;">Hello, world!</h1> | ||
<a href="http://google.com" class="google" style='color: #2c3e50;color: #c0392b; font-weight: 700; font-family: Verdana,"Open Sans"; font-size: 30px;'>Google</a> | ||
<a href="http://Facebook.com" class="facebook" style="color: #2c3e50;color: #8e44ad; margin: 300px;">Facebook</a> | ||
<a href="http://Outlook.com" id="outlook" style="color: #2c3e50;color: #2980b9; position: absolute; top: 30px; left: 500px; padding: 50px;">Outlook</a></body></html> | ||
EXPECTED; | ||
$this->assertSame($expected, $output); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
h1{color:#27ae60;font-size:200px;margin:10px 50px 80px 30px;} | ||
a{color:#2c3e50;} | ||
a#outlook{color:#2980b9;position:absolute;top:30px;left:500px;padding:50px;} | ||
a.facebook{color:#8e44ad;margin:300px;} | ||
a.google{color:#c0392b;font-weight:700;font-family:Verdana, 'Open Sans';font-size:30px;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<h1>Hello, world!</h1> | ||
<a href="http://google.com" class="google">Google</a> | ||
<a href="http://Facebook.com" class="facebook">Facebook</a> | ||
<a href="http://Outlook.com" id="outlook">Outlook</a> |