Skip to content

Commit 5736fcb

Browse files
committed
ProcessRulesetBrokenRulesetTest: more tweaks for different libxml output
Looks like there are some more libxml quirks to take into account with different message content on different OSes. This updates the tests to allow for them to pass on PHP < 8.0 with libxml 2.9.x on Windows.
1 parent 9981876 commit 5736fcb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*
2323
* @runTestsInSeparateProcesses
2424
* @preserveGlobalState disabled
25+
* @group Windows
2526
*
2627
* @covers \PHP_CodeSniffer\Ruleset::processRuleset
2728
*/
@@ -60,7 +61,7 @@ public function testBrokenRulesetSingleError()
6061
$config = new ConfigDouble(["--standard=$standard"]);
6162

6263
$regex = '`^ERROR: Ruleset \S+ProcessRulesetBrokenRulesetSingleErrorTest\.xml is not valid\R';
63-
$regex .= '- On line 3, column 1: Premature end of data in tag ruleset line 2\R$`';
64+
$regex .= '- On line 3, column 1: (Premature end of data in tag ruleset line 2|EndTag: \'</\' not found)\R$`';
6465

6566
$this->expectRuntimeExceptionRegex($regex);
6667

@@ -81,8 +82,8 @@ public function testBrokenRulesetMultiError()
8182

8283
$regex = '`^ERROR: Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R';
8384
$regex .= '- On line 8, column 12: Opening and ending tag mismatch: property line 7 and rule\R';
84-
$regex .= '- On line 10, column 11: Opening and ending tag mismatch: properties line 5 and ruleset\R';
85-
$regex .= '(- On line 11, column 1: Premature end of data in tag rule line 4\R)?$`';
85+
$regex .= '- On line 10, column 11: Opening and ending tag mismatch: properties line (5|7) and ruleset\R';
86+
$regex .= '(- On line 11, column 1: (Premature end of data in tag rule line 4|EndTag: \'</\' not found)\R)?$`';
8687

8788
$this->expectRuntimeExceptionRegex($regex);
8889

0 commit comments

Comments
 (0)