Skip to content

Commit 5b3f780

Browse files
committed
More tests for invalid selectors
1 parent 134f4e6 commit 5b3f780

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

tests/Sabberworm/CSS/ParserTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,15 @@ function testInvalidSelectorsInFile() {
438438
#test {color: white;background: green;}
439439
#test {display: block;background: white;color: black;}';
440440
$this->assertSame($sExpected, $oDoc->render());
441+
442+
$oDoc = $this->parsedStructureForFile('invalid-selectors-2', Settings::create()->withMultibyteSupport(true));
443+
$sExpected = '@media only screen and (max-width: 1215px) {.breadcrumb {padding-left: 10px;}
444+
.super-menu > li:first-of-type {border-left-width: 0;}
445+
.super-menu > li:last-of-type {border-right-width: 0;}
446+
html[dir="rtl"] .super-menu > li:first-of-type {border-left-width: 1px;border-right-width: 0;}
447+
html[dir="rtl"] .super-menu > li:last-of-type {border-left-width: 0;}}
448+
body {background-color: red;}';
449+
$this->assertSame($sExpected, $oDoc->render());
441450
}
442451

443452
/**

tests/files/invalid-selectors-2.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@media only screen and (max-width: 1215px) {
2+
.breadcrumb{
3+
padding-left:10px;
4+
}
5+
.super-menu > li:first-of-type{
6+
border-left-width:0;
7+
}
8+
.super-menu > li:last-of-type{
9+
border-right-width:0;
10+
}
11+
html[dir="rtl"] .super-menu > li:first-of-type{
12+
border-left-width:1px;
13+
border-right-width:0;
14+
}
15+
html[dir="rtl"] .super-menu > li:last-of-type{
16+
border-left-width:0;
17+
}
18+
html[dir="rtl"] .super-menu.menu-floated > li:first-of-type
19+
border-right-width:0;
20+
}
21+
}
22+
23+
24+
.super-menu.menu-floated{
25+
border-right-width:1px;
26+
border-left-width:1px;
27+
border-color:rgb(90, 66, 66);
28+
border-style:dotted;
29+
}
30+
31+
body {
32+
background-color: red;
33+
}

0 commit comments

Comments
 (0)