From 3f53bf6894dc4100a4dcc65f8c5643e5b5ccf877 Mon Sep 17 00:00:00 2001 From: Dennis Riehle Date: Tue, 24 Dec 2024 12:40:51 +0100 Subject: [PATCH 1/2] upgraded from PHPUnit 9 to 10 --- .gitignore | 2 +- composer.json | 2 +- phpunit.xml.dist | 16 ++++++++-------- .../ServiceFactory/ModuleDefinedServicesTest.php | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 34669ade..102cb5f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ /.phpcs.cache -/.phpunit.result.cache /coverage.xml /composer.lock /phpcs.xml /phpunit.xml +/.phpunit.cache/ /output/ /vendor/ diff --git a/composer.json b/composer.json index 3c7a2a58..0747d096 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "phpdocumentor/guides-cli": "^1.5.0", "phpstan/phpstan": "^1.9.2", "phpstan/phpstan-phpunit": "^1.3.0", - "phpunit/phpunit": "^9.5.27", + "phpunit/phpunit": "^10.5.40", "predis/predis": "^1.1.10" }, "conflict": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5835e874..e25a0ea7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,17 @@ - - - ./src - - + colors="true" + cacheDirectory=".phpunit.cache"> ./tests + + + ./src + + diff --git a/tests/ServiceFactory/ModuleDefinedServicesTest.php b/tests/ServiceFactory/ModuleDefinedServicesTest.php index 4cd13b5e..9f34275c 100644 --- a/tests/ServiceFactory/ModuleDefinedServicesTest.php +++ b/tests/ServiceFactory/ModuleDefinedServicesTest.php @@ -61,7 +61,7 @@ public function testModuleInvalidService(string $serviceName): void } /** @return mixed[][] */ - public function getServicesThatShouldBeDefined(): array + public static function getServicesThatShouldBeDefined(): array { $legacyCacheShouldExist = InstalledVersions::satisfies(new VersionParser(), 'doctrine/cache', '^1.0'); @@ -92,7 +92,7 @@ public function getServicesThatShouldBeDefined(): array } /** @return string[][] */ - public function getServicesThatCanBeFetched(): array + public static function getServicesThatCanBeFetched(): array { if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/cache', '^1.0')) { return [ @@ -110,7 +110,7 @@ public function getServicesThatCanBeFetched(): array } /** @return string[][] */ - public function getServicesThatCannotBeFetched(): array + public static function getServicesThatCannotBeFetched(): array { return [ ['foo'], From 1c008a5c7907a10eb5a33ef31788976081864194 Mon Sep 17 00:00:00 2001 From: Dennis Riehle Date: Tue, 24 Dec 2024 14:01:11 +0100 Subject: [PATCH 2/2] @coversDefaultClass needs FQDN --- tests/Service/CacheFactoryTest.php | 4 ++-- tests/Validator/Service/NoObjectExistsFactoryTest.php | 4 +--- tests/Validator/Service/ObjectExistsFactoryTest.php | 2 +- tests/Validator/Service/UniqueObjectFactoryTest.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/Service/CacheFactoryTest.php b/tests/Service/CacheFactoryTest.php index 40f1e7c2..65897e0d 100644 --- a/tests/Service/CacheFactoryTest.php +++ b/tests/Service/CacheFactoryTest.php @@ -24,7 +24,7 @@ */ class CacheFactoryTest extends BaseTestCase { - /** @covers \DoctrineModule\Service\CacheFactory::createService */ + /** @covers \DoctrineModule\Service\CacheFactory::__invoke */ public function testWillSetNamespace(): void { if (! InstalledVersions::satisfies(new VersionParser(), 'doctrine/cache', '^1.0.0')) { @@ -55,7 +55,7 @@ public function testWillSetNamespace(): void } /** - * @covers \DoctrineModule\Service\CacheFactory::createService + * @covers \DoctrineModule\Service\CacheFactory::__invoke * @group 547 */ public function testCreateLaminasCache(): void diff --git a/tests/Validator/Service/NoObjectExistsFactoryTest.php b/tests/Validator/Service/NoObjectExistsFactoryTest.php index aa7a9174..868b878d 100644 --- a/tests/Validator/Service/NoObjectExistsFactoryTest.php +++ b/tests/Validator/Service/NoObjectExistsFactoryTest.php @@ -17,7 +17,7 @@ /** * Generated by PHPUnit_SkeletonGenerator on 2017-09-04 at 11:12:27. * - * @coversDefaultClass NoObjectExistsFactory + * @coversDefaultClass \DoctrineModule\Validator\Service\NoObjectExistsFactory * @group validator */ class NoObjectExistsFactoryTest extends TestCase @@ -41,7 +41,6 @@ public function testCallable(): void /** * @covers ::__invoke - * @covers ::container * @covers ::getRepository * @covers ::getObjectManager * @covers ::getFields @@ -78,7 +77,6 @@ public function testInvoke(): void /** * @covers ::__invoke - * @covers ::container * @covers ::getRepository * @covers ::getObjectManager * @covers ::getFields diff --git a/tests/Validator/Service/ObjectExistsFactoryTest.php b/tests/Validator/Service/ObjectExistsFactoryTest.php index 34a38664..b306a09e 100644 --- a/tests/Validator/Service/ObjectExistsFactoryTest.php +++ b/tests/Validator/Service/ObjectExistsFactoryTest.php @@ -15,7 +15,7 @@ /** * Generated by PHPUnit_SkeletonGenerator on 2017-09-04 at 11:55:36. * - * @coversDefaultClass ObjectExistsFactory + * @coversDefaultClass \DoctrineModule\Validator\Service\ObjectExistsFactory * @group validator */ class ObjectExistsFactoryTest extends TestCase diff --git a/tests/Validator/Service/UniqueObjectFactoryTest.php b/tests/Validator/Service/UniqueObjectFactoryTest.php index 46f4b97a..4874d196 100644 --- a/tests/Validator/Service/UniqueObjectFactoryTest.php +++ b/tests/Validator/Service/UniqueObjectFactoryTest.php @@ -15,7 +15,7 @@ /** * Generated by PHPUnit_SkeletonGenerator on 2017-09-04 at 11:57:37. * - * @coversDefaultClass UniqueObjectFactory + * @coversDefaultClass \DoctrineModule\Validator\Service\UniqueObjectFactory * @group validator */ class UniqueObjectFactoryTest extends TestCase