Skip to content

Commit 7154a8f

Browse files
committed
Trying to reproduce a bug on php 8+
1 parent f9f3e40 commit 7154a8f

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
@@ -131,4 +131,26 @@ public function caseInsensitivity()
131131
$oResult->render()
132132
);
133133
}
134+
135+
/**
136+
* @test
137+
*/
138+
public function invalidColor()
139+
{
140+
$sFile = __DIR__ . '/../fixtures/invalid-color.css';
141+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
142+
$oParser->parse();
143+
}
144+
145+
/**
146+
* @test
147+
*/
148+
public function invalidColorStrict()
149+
{
150+
$this->expectException(UnexpectedTokenException::class);
151+
152+
$sFile = __DIR__ . '/../fixtures/invalid-color.css';
153+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
154+
$oParser->parse();
155+
}
134156
}

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)