From 0a098f8c64b46fc5394c128702059eda007befe9 Mon Sep 17 00:00:00 2001 From: Asis Pattisahusiwa <79239132+asispts@users.noreply.github.com> Date: Sat, 25 Jan 2025 18:13:05 +0700 Subject: [PATCH 1/3] Fix libxml >= 2.12 compatibility --- tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php index 95f67c21df..3cd1469970 100644 --- a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php +++ b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php @@ -39,7 +39,9 @@ public function testBrokenRulesetEmptyFile() $standard = __DIR__.'/ProcessRulesetBrokenRulesetEmptyFileTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); - $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R$`'; + $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R'; + $regex .= '(- On line 1, column 1: Document is empty\R)?$#'; + $this->expectRuntimeExceptionRegex($regex); new Ruleset($config); @@ -77,10 +79,10 @@ public function testBrokenRulesetMultiError() $standard = __DIR__.'/ProcessRulesetBrokenRulesetMultiErrorTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); - $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R'; + $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R'; $regex .= '- On line 8, column 12: Opening and ending tag mismatch: property line 7 and rule\R'; $regex .= '- On line 10, column 11: Opening and ending tag mismatch: properties line 5 and ruleset\R'; - $regex .= '- On line 11, column 1: Premature end of data in tag rule line 4\R$`'; + $regex .= '(- On line 11, column 1: Premature end of data in tag rule line 4\R)?$#'; $this->expectRuntimeExceptionRegex($regex); From f2312fc26f264cba38f5e7c78f68d3d5a699455a Mon Sep 17 00:00:00 2001 From: Asis Pattisahusiwa <79239132+asispts@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:53:10 +0700 Subject: [PATCH 2/3] Fix coding style --- tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php index 3cd1469970..861bb4f8b0 100644 --- a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php +++ b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php @@ -39,7 +39,7 @@ public function testBrokenRulesetEmptyFile() $standard = __DIR__.'/ProcessRulesetBrokenRulesetEmptyFileTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); - $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R'; + $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R'; $regex .= '(- On line 1, column 1: Document is empty\R)?$#'; $this->expectRuntimeExceptionRegex($regex); From bf3562d8939f9d738a4a38ec6a909eeb5194ad25 Mon Sep 17 00:00:00 2001 From: Asis Pattisahusiwa <79239132+asispts@users.noreply.github.com> Date: Sat, 25 Jan 2025 22:08:08 +0700 Subject: [PATCH 3/3] Bring back regex delimiters --- tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php index 861bb4f8b0..9e16f83892 100644 --- a/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php +++ b/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php @@ -39,8 +39,8 @@ public function testBrokenRulesetEmptyFile() $standard = __DIR__.'/ProcessRulesetBrokenRulesetEmptyFileTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); - $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R'; - $regex .= '(- On line 1, column 1: Document is empty\R)?$#'; + $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R'; + $regex .= '(- On line 1, column 1: Document is empty\R)?$`'; $this->expectRuntimeExceptionRegex($regex); @@ -79,10 +79,10 @@ public function testBrokenRulesetMultiError() $standard = __DIR__.'/ProcessRulesetBrokenRulesetMultiErrorTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); - $regex = '#^Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R'; + $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R'; $regex .= '- On line 8, column 12: Opening and ending tag mismatch: property line 7 and rule\R'; $regex .= '- On line 10, column 11: Opening and ending tag mismatch: properties line 5 and ruleset\R'; - $regex .= '(- On line 11, column 1: Premature end of data in tag rule line 4\R)?$#'; + $regex .= '(- On line 11, column 1: Premature end of data in tag rule line 4\R)?$`'; $this->expectRuntimeExceptionRegex($regex);