PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

Run the parser tests with both strict and lenient parsing

Open JakeQZ opened this issue 1 year ago • 4 comments

#352 only occurred with strict parsing, so was not picked up by the tests.

IIRC, there are some contructs in PHPUnit to run a whole TestCase more than once with differing 'global' parameters. I remember looking into it, but don't recall the details, and never used it.

JakeQZ avatar Feb 10 '24 01:02 JakeQZ

Some tests do fail with strict parsing, because they have deliberately invalid constructs. So this is not as easy to achieve as it might sound. However, there is already a file naming convention in the fixtures (used for tests that should pass, and those that should fail) that could be extended...

JakeQZ avatar Feb 10 '24 02:02 JakeQZ

For now, I'm adding the naming convention of a filename starting with = meaning the test should be run with the 'strict' option...

JakeQZ avatar Feb 10 '24 02:02 JakeQZ

Actually, I'd like to get rid of the switch for strict/lenient parsing (because it add so much complexity both to the code and our testing efforts) and use a default mode instead that mimics what browsers do. I added this to my "road to version 9.0.0" discussion: #454

oliverklee avatar Feb 10 '24 09:02 oliverklee

After #460, #461, #462 and #463 are resolved, this will become a non-issue. I only added it to avoid a repeat of something like #352 which manifested as a BC. So can probably close this as `wontimplement'.

JakeQZ avatar Feb 20 '24 23:02 JakeQZ