diff --git a/composer.json b/composer.json index 72496cc..1c0023b 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "bringyourownideas/silverstripe-maintenance": "^4" }, "require-dev": { - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^11.3", "squizlabs/php_codesniffer": "^3", "silverstripe/standards": "^1", "phpstan/extension-installer": "^1.3" diff --git a/tests/Extensions/CheckComposerUpdatesExtensionTest.php b/tests/Extensions/CheckComposerUpdatesExtensionTest.php index be33726..b4bf629 100644 --- a/tests/Extensions/CheckComposerUpdatesExtensionTest.php +++ b/tests/Extensions/CheckComposerUpdatesExtensionTest.php @@ -43,7 +43,7 @@ protected function setUp(): void $this->task = UpdatePackageInfoTask::create(); // Create a partial mock of the update checker - $updateCheckerMock = $this->getMockBuilder(UpdateChecker::class)->setMethods(['checkForUpdates'])->getMock(); + $updateCheckerMock = $this->getMockBuilder(UpdateChecker::class)->onlyMethods(['checkForUpdates'])->getMock(); $this->task->setUpdateChecker($updateCheckerMock); $this->allowedTypes = ['silverstripe-module', 'silverstripe-vendormodule', 'silverstripe-theme']; diff --git a/tests/UpdateCheckerTest.php b/tests/UpdateCheckerTest.php index 53d662c..b13893f 100644 --- a/tests/UpdateCheckerTest.php +++ b/tests/UpdateCheckerTest.php @@ -25,14 +25,14 @@ protected function setUp(): void $composer = $this->getMockBuilder(Composer::class)->getMock(); $composerLoader = $this->getMockBuilder(ComposerLoader::class) ->disableOriginalConstructor() - ->setMethods(['getComposer']) + ->onlyMethods(['getComposer']) ->getMock(); $composerLoader->expects($this->once())->method('getComposer')->will($this->returnValue($composer)); Injector::inst()->registerService($composerLoader, ComposerLoader::class); // Partially mock UpdateChecker $this->updateChecker = $this->getMockBuilder(UpdateChecker::class) - ->setMethods(['findLatestPackage']) + ->onlyMethods(['findLatestPackage']) ->getMock(); }