From 240a63e40648d71e5ece7d51f7552460b716daea Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 6 Feb 2026 16:03:36 -0500 Subject: [PATCH 1/2] Fix callable syntax for PHP 8.2 --- src/AspectMock/Util/ArgumentsFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AspectMock/Util/ArgumentsFormatter.php b/src/AspectMock/Util/ArgumentsFormatter.php index 4dfd3f3..e28f322 100644 --- a/src/AspectMock/Util/ArgumentsFormatter.php +++ b/src/AspectMock/Util/ArgumentsFormatter.php @@ -10,7 +10,7 @@ final class ArgumentsFormatter { public static function toString($args): string { - return implode(',',array_map('self::format', $args)); + return implode(',',array_map([self::class, 'format'], $args)); } protected static function format($arg) From 35bc9ac266caf8055d30093b5fc08686a2bec0a8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Feb 2026 03:49:15 +0000 Subject: [PATCH 2/2] Add support for PHPUnit 10-13 - Widen phpunit/phpunit constraint from ^9.5 to ^9.5 | ^10.0 | ^11.0 | ^12.0 | ^13.0 - Widen symfony/finder constraint to include ^7.0 - Widen codeception/codeception dev constraint to include ^5.0 - Replace deprecated PHPUnit_ prefixed class references with modern PHPUnit\Framework\ namespaced equivalents (removed in PHPUnit 10): - UserModel.php: \PHPUnit_Framework_AssertionFailedError - codeception.yml: \PHPUnit_Framework_TestSuite - README.md: \PHPUnit_Framework_TestCase - Add void return type to tearDown() in README example for PHPUnit 10+ The core library (Verifier.php) already uses stable modern PHPUnit APIs (Assert::assertTrue, ExpectationFailedException) that are compatible across all supported versions. https://claude.ai/code/session_01JmkRkNzxZmpB8pRLLTs3Fk --- README.md | 4 ++-- codeception.yml | 2 +- composer.json | 6 +++--- tests/_data/demo/UserModel.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 168a819..2932209 100644 --- a/README.md +++ b/README.md @@ -278,9 +278,9 @@ Clear the test doubles registry between tests. use AspectMock\Test as test; -class UserTest extends \PHPUnit_Framework_TestCase +class UserTest extends \PHPUnit\Framework\TestCase { - protected function tearDown() + protected function tearDown(): void { test::clean(); // remove all registered test doubles } diff --git a/codeception.yml b/codeception.yml index 9c5a4ce..0bbe5b3 100644 --- a/codeception.yml +++ b/codeception.yml @@ -5,7 +5,7 @@ paths: helpers: tests/_helpers bootstrap: _bootstrap.php settings: - suite_class: \PHPUnit_Framework_TestSuite + suite_class: \PHPUnit\Framework\TestSuite colors: true memory_limit: 1024M log: true diff --git a/composer.json b/composer.json index 7f79282..af11b72 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ "php": "^8.2", "goaop/framework": "^4.0@dev", "goaop/parser-reflection": "^4.0@dev", - "phpunit/phpunit": "^9.5", - "symfony/finder": "^4.4 | ^5.4 | ^6.0" + "phpunit/phpunit": "^9.5 | ^10.0 | ^11.0 | ^12.0 | ^13.0", + "symfony/finder": "^4.4 | ^5.4 | ^6.0 | ^7.0" }, "require-dev": { - "codeception/codeception": "^4.1", + "codeception/codeception": "^4.1 | ^5.0", "codeception/verify": "^2.2", "codeception/specify": "^2.0", "consolidation/robo": "^3.0" diff --git a/tests/_data/demo/UserModel.php b/tests/_data/demo/UserModel.php index d57f327..1a940ab 100644 --- a/tests/_data/demo/UserModel.php +++ b/tests/_data/demo/UserModel.php @@ -10,7 +10,7 @@ class UserModel { public static function getTopSecret() { - throw new \PHPUnit_Framework_AssertionFailedError("I am not going to tell you"); + throw new \PHPUnit\Framework\AssertionFailedError("I am not going to tell you"); } static function tableName()