From dc4cf8896bf47647080dc5709a2c67ee9d437c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 21 Mar 2023 07:55:31 +0100 Subject: [PATCH] fix: PHPUnit 10.0.17 compatibility (#57) --- classes/PHPMock.php | 8 +++++--- composer.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/classes/PHPMock.php b/classes/PHPMock.php index 40f08b8..166d9d2 100644 --- a/classes/PHPMock.php +++ b/classes/PHPMock.php @@ -98,15 +98,17 @@ private function addMatcher($mock, $name) public function registerForTearDown(Deactivatable $deactivatable) { if (class_exists(Facade::class)) { + $facade = Facade::instance(); + $property = new ReflectionProperty(Facade::class, 'sealed'); $property->setAccessible(true); - $property->setValue(false); + $property->setValue($facade, false); - Facade::registerSubscriber( + $facade->registerSubscriber( new MockDisabler($deactivatable) ); - $property->setValue(true); + $property->setValue($facade, true); return; } diff --git a/composer.json b/composer.json index 3683e25..8b8e15f 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": ">=7", - "phpunit/phpunit": "^6 || ^7 || ^8 || ^9 || ^10", + "phpunit/phpunit": "^6 || ^7 || ^8 || ^9 || ^10.0.17", "php-mock/php-mock-integration": "^2.2.1" }, "require-dev": {