Skip to content

Commit d1470fe

Browse files
committed
Add test for URLs
1 parent c575b61 commit d1470fe

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/Sabberworm/CSS/ParserTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,20 @@ function testComments() {
377377
$this->assertSame($sExpected, $oDoc->render());
378378
}
379379

380+
function testUrlInFile() {
381+
$oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(true));
382+
$sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
383+
body {background-url: url("http://somesite.com/images/someimage.gif");}';
384+
$this->assertSame($sExpected, $oDoc->render());
385+
}
386+
387+
function testUrlInFileMbOff() {
388+
$oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(false));
389+
$sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
390+
body {background-url: url("http://somesite.com/images/someimage.gif");}';
391+
$this->assertSame($sExpected, $oDoc->render());
392+
}
393+
380394
function testEmptyFile() {
381395
$oDoc = $this->parsedStructureForFile('-empty', Settings::create()->withMultibyteSupport(true));
382396
$sExpected = '';

tests/files/url.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body { background: #FFFFFF url("http://somesite.com/images/someimage.gif") repeat top center; }
2+
body {
3+
background-url: url("http://somesite.com/images/someimage.gif");
4+
}

0 commit comments

Comments
 (0)