@@ -11,24 +11,33 @@ class LenientParsingTest extends \PHPUnit_Framework_TestCase {
11
11
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
12
12
*/
13
13
public function testFaultToleranceOff () {
14
- $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "fault-tolerance.css " ;
14
+ $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "- fault-tolerance.css " ;
15
15
$ oParser = new Parser (file_get_contents ($ sFile ), Settings::create ()->beStrict ());
16
16
$ oParser ->parse ();
17
17
}
18
18
19
19
public function testFaultToleranceOn () {
20
- $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "fault-tolerance.css " ;
20
+ $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "- fault-tolerance.css " ;
21
21
$ oParser = new Parser (file_get_contents ($ sFile ), Settings::create ()->withLenientParsing (true ));
22
22
$ oResult = $ oParser ->parse ();
23
- $ this ->assertSame ('.test1 {} ' ."\n" .'.test2 {hello: 2.2;hello: 200000000000.2;} ' ."\n" , $ oResult ->__toString ());
23
+ $ this ->assertSame ('.test1 {} ' ."\n" .'.test2 {hello: 2.2;hello: 200000000000.2;} ' ."\n" .'#test {} ' ."\n" .'#test2 {help: none;} ' ."\n" , $ oResult ->__toString ());
24
+ }
25
+
26
+ /**
27
+ * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
28
+ */
29
+ public function testEndToken () {
30
+ $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "-end-token.css " ;
31
+ $ oParser = new Parser (file_get_contents ($ sFile ), Settings::create ()->beStrict ());
32
+ $ oResult = $ oParser ->parse ();
24
33
}
25
34
26
35
public function testLocaleTrap () {
27
36
setlocale (LC_ALL , "pt_PT " , "no " );
28
- $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "fault-tolerance.css " ;
37
+ $ sFile = dirname (__FILE__ ) . '/../../../files ' . DIRECTORY_SEPARATOR . "- fault-tolerance.css " ;
29
38
$ oParser = new Parser (file_get_contents ($ sFile ), Settings::create ()->withLenientParsing (true ));
30
39
$ oResult = $ oParser ->parse ();
31
- $ this ->assertSame ('.test1 {} ' ."\n" .'.test2 {hello: 2.2;hello: 200000000000.2;} ' ."\n" , $ oResult ->__toString ());
40
+ $ this ->assertSame ('.test1 {} ' ."\n" .'.test2 {hello: 2.2;hello: 200000000000.2;} ' ."\n" . ' #test {} ' . "\n" . ' #test2 {help: none;} ' . "\n" , $ oResult ->__toString ());
32
41
}
33
42
34
43
public function testCaseInsensitivity () {
0 commit comments