Skip to content

Commit

Permalink
fix: PHPUnit 10.0.17 compatibility (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra authored Mar 21, 2023
1 parent 97b3278 commit dc4cf88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions classes/PHPMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit dc4cf88

Please sign in to comment.