From 6f9669862f9ac8a7dfa77dc7e3c45689615b67c0 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 12 Sep 2025 16:52:34 +0200 Subject: [PATCH] Composer: raise minimum PHPUnit 8 version to 8.4.0 ... to allow for a simplification in the test suite. --- composer.json | 2 +- tests/Core/Ruleset/AbstractRulesetTestCase.php | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index cb9f91a4f1..310b29eea2 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "ext-xmlwriter": "*" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31" + "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31" }, "bin": [ "bin/phpcbf", diff --git a/tests/Core/Ruleset/AbstractRulesetTestCase.php b/tests/Core/Ruleset/AbstractRulesetTestCase.php index 8972b398cc..e0502367ef 100644 --- a/tests/Core/Ruleset/AbstractRulesetTestCase.php +++ b/tests/Core/Ruleset/AbstractRulesetTestCase.php @@ -73,8 +73,7 @@ protected function expectRuntimeExceptionMessage($message) /** - * Helper method to tell PHPUnit to expect a PHPCS RuntimeException which matches a regex patten - * in a PHPUnit cross-version compatible manner. + * Helper method to tell PHPUnit to expect a PHPCS RuntimeException which matches a regex pattern. * * @param string $regex The regex which should match. * @@ -82,13 +81,7 @@ protected function expectRuntimeExceptionMessage($message) */ protected function expectRuntimeExceptionRegex($regex) { - if (method_exists($this, 'expectExceptionMessageMatches') === true) { - $this->expectException(RuntimeException::class); - $this->expectExceptionMessageMatches($regex); - } else { - // PHPUnit < 8.4.0. - $this->expectException(RuntimeException::class); - $this->expectExceptionMessageRegExp($regex); - } + $this->expectException(RuntimeException::class); + $this->expectExceptionMessageMatches($regex); } }