File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests ;
4+ use Northys \CSSInliner \CSSInliner ;
5+
6+ /**
7+ * Class CSSInlinerTest
8+ *
9+ * @package Tests
10+ */
11+ class CSSInlinerTest extends \PHPUnit_Framework_TestCase
12+ {
13+
14+ /**
15+ * Test Component
16+ */
17+ public function testComponent ()
18+ {
19+ $ inliner = new CSSInliner ;
20+ $ inliner ->addCSS (__DIR__ . '/test.css ' );
21+ $ output = $ inliner ->render (file_get_contents ('test.html ' ), true );
22+ $ expected = <<<EXPECTED
23+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
24+ <html><body><h1 style="color: #27ae60; font-size: 200px; margin: 10px 50px 80px 30px;">Hello, world!</h1>
25+ <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>
26+ <a href="http://Facebook.com" class="facebook" style="color: #2c3e50;color: #8e44ad; margin: 300px;">Facebook</a>
27+ <a href="http://Outlook.com" id="outlook" style="color: #2c3e50;color: #2980b9; position: absolute; top: 30px; left: 500px; padding: 50px;">Outlook</a></body></html>
28+
29+ EXPECTED ;
30+ $ this ->assertSame ($ expected , $ output );
31+ }
32+
33+ }
Original file line number Diff line number Diff line change 1+ h1 {color : # 27ae60 ;font-size : 200px ;margin : 10px 50px 80px 30px ;}
2+ a {color : # 2c3e50 ;}
3+ a # outlook {color : # 2980b9 ;position : absolute;top : 30px ;left : 500px ;padding : 50px ;}
4+ a .facebook {color : # 8e44ad ;margin : 300px ;}
5+ a .google {color : # c0392b ;font-weight : 700 ;font-family : Verdana, 'Open Sans' ;font-size : 30px ;}
Original file line number Diff line number Diff line change 1+ < h1 > Hello, world!</ h1 >
2+ < a href ="http://google.com " class ="google "> Google</ a >
3+ < a href ="http://Facebook.com " class ="facebook "> Facebook</ a >
4+ < a href ="http://Outlook.com " id ="outlook "> Outlook</ a >
You can’t perform that action at this time.
0 commit comments