From b599039fa6fd5214922bf688235a54fc74d80587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Wed, 19 Mar 2025 20:54:34 +0000 Subject: [PATCH] feat: Support for PHPUnit 12.0.9 Closes #79 --- autoload.php | 15 +++++++++++---- classes/MockObjectProxyReturnTypes120.php | 4 ++-- composer.json | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/autoload.php b/autoload.php index f567a6a..e16fa67 100644 --- a/autoload.php +++ b/autoload.php @@ -29,10 +29,17 @@ class_alias( } if (! class_exists(\PHPUnit\Framework\MockObject\Builder\InvocationMocker::class)) { - class_alias( - \PHPUnit_Framework_MockObject_Builder_InvocationMocker::class, - \PHPUnit\Framework\MockObject\Builder\InvocationMocker::class - ); + if (class_exists(\PHPUnit\Framework\MockObject\InvocationStubberImplementation::class)) { + class_alias( + \PHPUnit\Framework\MockObject\InvocationStubberImplementation::class, + \PHPUnit\Framework\MockObject\Builder\InvocationMocker::class + ); + } else { + class_alias( + \PHPUnit_Framework_MockObject_Builder_InvocationMocker::class, + \PHPUnit\Framework\MockObject\Builder\InvocationMocker::class + ); + } } if (class_exists(\PHPUnit\Framework\MockObject\Rule\MethodName::class)) { diff --git a/classes/MockObjectProxyReturnTypes120.php b/classes/MockObjectProxyReturnTypes120.php index f30503e..8cb79b8 100644 --- a/classes/MockObjectProxyReturnTypes120.php +++ b/classes/MockObjectProxyReturnTypes120.php @@ -4,8 +4,8 @@ use phpmock\integration\MockDelegateFunctionBuilder; use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker; -use PHPUnit\Framework\MockObject\Builder\InvocationStubber; +use PHPUnit\Framework\MockObject\InvocationStubberImplementation as BuilderInvocationMocker; +use PHPUnit\Framework\MockObject\InvocationStubber; use PHPUnit\Framework\MockObject\InvocationHandler; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Rule\InvocationOrder; diff --git a/composer.json b/composer.json index 702ebe8..bbd0703 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": ">=7", - "phpunit/phpunit": "^6 || ^7 || ^8 || ^9 || ^10.0.17 || ^11 || ^12", + "phpunit/phpunit": "^6 || ^7 || ^8 || ^9 || ^10.0.17 || ^11 || ^12.0.9", "php-mock/php-mock-integration": "^3.0" }, "require-dev": {