Skip to content

Commit b90d536

Browse files
committed
Trying to reproduce a bug on php 8+
1 parent 89abe89 commit b90d536

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/RuleSet/LenientParsingTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,26 @@ public function caseInsensitivity()
130130
$oResult->render()
131131
);
132132
}
133+
134+
/**
135+
* @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
136+
*
137+
* @test
138+
*/
139+
public function invalidColor()
140+
{
141+
$sFile = __DIR__ . '/../fixtures/invalid-color.css';
142+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
143+
$oParser->parse();
144+
}
145+
146+
/**
147+
* @test
148+
*/
149+
public function invalidColor2()
150+
{
151+
$sFile = __DIR__ . '/../fixtures/invalid-color.css';
152+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
153+
$oParser->parse();
154+
}
133155
}

tests/fixtures/invalid-color.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#test {
2+
color: #a;
3+
background: #ab;
4+
}
5+
6+
body
7+
color: #abcd;
8+
background: #abcde;
9+
}
10+
11+
a { color: #fffff;}

0 commit comments

Comments
 (0)