From 83391aa027dbaa3667878b3eef42cc95d8b07e3d Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 15:45:08 +0100 Subject: [PATCH 01/12] ci: remove usage of soyuka/phpunit --- composer.json | 7 ++----- src/Doctrine/Common/composer.json | 10 ++-------- src/Doctrine/Odm/composer.json | 10 ++-------- src/Doctrine/Orm/composer.json | 10 ++-------- src/Documentation/composer.json | 10 ++-------- src/Elasticsearch/composer.json | 10 ++-------- src/GraphQl/composer.json | 10 ++-------- src/Hal/composer.json | 10 ++-------- src/HttpCache/composer.json | 10 ++-------- src/Hydra/composer.json | 10 ++-------- src/JsonApi/composer.json | 10 ++-------- src/JsonLd/composer.json | 10 ++-------- src/JsonSchema/composer.json | 10 ++-------- src/Laravel/composer.json | 10 ++-------- src/Metadata/composer.json | 10 ++-------- src/OpenApi/composer.json | 10 ++-------- src/RamseyUuid/composer.json | 10 ++-------- src/Serializer/composer.json | 10 ++-------- src/State/composer.json | 10 ++-------- src/Symfony/composer.json | 10 ++-------- src/Validator/composer.json | 10 ++-------- 21 files changed, 42 insertions(+), 165 deletions(-) diff --git a/composer.json b/composer.json index a0f3bbc9e4..55f0d023d0 100644 --- a/composer.json +++ b/composer.json @@ -156,7 +156,7 @@ "phpstan/phpstan-doctrine": "^2.0", "phpstan/phpstan-phpunit": "^2.0", "phpstan/phpstan-symfony": "^2.0", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "psr/log": "^1.0 || ^2.0 || ^3.0", "ramsey/uuid": "^4.7", "ramsey/uuid-doctrine": "^2.0", @@ -216,8 +216,5 @@ "symfony/json-streamer": "To use the JSON Streamer component.", "webonyx/graphql-php": "To support GraphQL." }, - "type": "library", - "repositories": [ - {"type": "vcs", "url": "https://github.com/soyuka/phpunit"} - ] + "type": "library" } diff --git a/src/Doctrine/Common/composer.json b/src/Doctrine/Common/composer.json index b99b133d29..4255d2ff8c 100644 --- a/src/Doctrine/Common/composer.json +++ b/src/Doctrine/Common/composer.json @@ -34,7 +34,7 @@ "doctrine/mongodb-odm": "^2.10", "doctrine/orm": "^2.17 || ^3.0", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "conflict": { @@ -76,11 +76,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Doctrine/Odm/composer.json b/src/Doctrine/Odm/composer.json index 547dfc8f4e..cbca401032 100644 --- a/src/Doctrine/Odm/composer.json +++ b/src/Doctrine/Odm/composer.json @@ -36,7 +36,7 @@ "doctrine/doctrine-bundle": "^2.11 || ^3.1", "doctrine/mongodb-odm-bundle": "^5.0", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/cache": "^6.4 || ^7.0 || ^8.0", "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", "symfony/property-access": "^6.4 || ^7.0 || ^8.0", @@ -76,11 +76,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Doctrine/Orm/composer.json b/src/Doctrine/Orm/composer.json index 8952b55530..0fb956e21f 100644 --- a/src/Doctrine/Orm/composer.json +++ b/src/Doctrine/Orm/composer.json @@ -32,7 +32,7 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.11 || ^3.1", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "ramsey/uuid": "^4.7", "ramsey/uuid-doctrine": "^2.0", "symfony/cache": "^6.4 || ^7.0 || ^8.0", @@ -76,11 +76,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Documentation/composer.json b/src/Documentation/composer.json index 01bbdc9743..ffc9291d30 100644 --- a/src/Documentation/composer.json +++ b/src/Documentation/composer.json @@ -39,12 +39,6 @@ } }, "require-dev": { - "phpunit/phpunit": "11.5.x-dev" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + "phpunit/phpunit": "^12.2" + } } diff --git a/src/Elasticsearch/composer.json b/src/Elasticsearch/composer.json index b23b4dfe7f..9cb069e9bb 100644 --- a/src/Elasticsearch/composer.json +++ b/src/Elasticsearch/composer.json @@ -38,7 +38,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -76,11 +76,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/GraphQl/composer.json b/src/GraphQl/composer.json index 5f9c3c0d6f..d7434df70f 100644 --- a/src/GraphQl/composer.json +++ b/src/GraphQl/composer.json @@ -36,7 +36,7 @@ "twig/twig": "^1.42.3 || ^2.12 || ^3.0", "symfony/mercure-bundle": "*", "symfony/routing": "^6.4 || ^7.0 || ^8.0", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -83,11 +83,5 @@ "conflict": { "symfony/http-client": "<6.4", "doctrine/inflector": "<2.0" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Hal/composer.json b/src/Hal/composer.json index 9f0c12a526..2a86e13006 100644 --- a/src/Hal/composer.json +++ b/src/Hal/composer.json @@ -65,13 +65,7 @@ "test": "./vendor/bin/phpunit" }, "require-dev": { - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "api-platform/json-schema": "^4.1.11" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/HttpCache/composer.json b/src/HttpCache/composer.json index 9ab7341141..7f8ba1096b 100644 --- a/src/HttpCache/composer.json +++ b/src/HttpCache/composer.json @@ -33,7 +33,7 @@ "phpspec/prophecy-phpunit": "^2.2", "symfony/http-client": "^6.4 || ^7.0 || ^8.0", "symfony/type-info": "^7.3 || ^8.0", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -70,11 +70,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Hydra/composer.json b/src/Hydra/composer.json index 0e2614722c..c149384e84 100644 --- a/src/Hydra/composer.json +++ b/src/Hydra/composer.json @@ -40,7 +40,7 @@ "api-platform/doctrine-common": "^4.2", "phpspec/prophecy": "^1.19", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -77,11 +77,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/JsonApi/composer.json b/src/JsonApi/composer.json index 1e4190928c..c1fa5481ab 100644 --- a/src/JsonApi/composer.json +++ b/src/JsonApi/composer.json @@ -34,7 +34,7 @@ "require-dev": { "phpspec/prophecy": "^1.19", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "autoload": { @@ -72,11 +72,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/JsonLd/composer.json b/src/JsonLd/composer.json index a943fc85f0..114a9a1ca3 100644 --- a/src/JsonLd/composer.json +++ b/src/JsonLd/composer.json @@ -69,12 +69,6 @@ }, "require-dev": { "symfony/type-info": "^7.3 || ^8.0", - "phpunit/phpunit": "11.5.x-dev" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + "phpunit/phpunit": "^12.2" + } } diff --git a/src/JsonSchema/composer.json b/src/JsonSchema/composer.json index 3e629bd329..4ac6fa87cb 100644 --- a/src/JsonSchema/composer.json +++ b/src/JsonSchema/composer.json @@ -34,7 +34,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -71,11 +71,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Laravel/composer.json b/src/Laravel/composer.json index 5182488443..92d1c1d880 100644 --- a/src/Laravel/composer.json +++ b/src/Laravel/composer.json @@ -61,7 +61,7 @@ "orchestra/testbench": "^10.1", "phpdocumentor/type-resolver": "^1.7", "phpstan/phpdoc-parser": "^1.29 || ^2.0", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/http-client": "^7.4 || ^8.0" }, "autoload": { @@ -127,11 +127,5 @@ "lint": [ "@php vendor/bin/phpstan analyse --verbose --ansi" ] - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Metadata/composer.json b/src/Metadata/composer.json index 1b72326878..d055403541 100644 --- a/src/Metadata/composer.json +++ b/src/Metadata/composer.json @@ -41,7 +41,7 @@ "api-platform/state": "^4.2.4", "phpspec/prophecy-phpunit": "^2.2", "phpstan/phpdoc-parser": "^1.29 || ^2.0", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/config": "^6.4 || ^7.0 || ^8.0", "symfony/routing": "^6.4 || ^7.0 || ^8.0", "symfony/var-dumper": "^6.4 || ^7.0 || ^8.0", @@ -88,11 +88,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/OpenApi/composer.json b/src/OpenApi/composer.json index ac0b0ca821..00153da6c4 100644 --- a/src/OpenApi/composer.json +++ b/src/OpenApi/composer.json @@ -39,7 +39,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "api-platform/doctrine-common": "^4.2", "api-platform/doctrine-orm": "^4.2", "api-platform/doctrine-odm": "^4.2", @@ -80,11 +80,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/RamseyUuid/composer.json b/src/RamseyUuid/composer.json index 141300f2d3..02df35226f 100644 --- a/src/RamseyUuid/composer.json +++ b/src/RamseyUuid/composer.json @@ -30,7 +30,7 @@ "phpspec/prophecy-phpunit": "^2.2", "ramsey/uuid": "^4.7", "ramsey/uuid-doctrine": "^2.0", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "autoload": { @@ -65,11 +65,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Serializer/composer.json b/src/Serializer/composer.json index 7341fcfa43..b6005860cf 100644 --- a/src/Serializer/composer.json +++ b/src/Serializer/composer.json @@ -38,7 +38,7 @@ "api-platform/openapi": "^4.2", "doctrine/collections": "^2.1", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/mercure-bundle": "*", "symfony/var-dumper": "^6.4 || ^7.0 || ^8.0", "symfony/yaml": "^6.4 || ^7.0 || ^8.0", @@ -83,11 +83,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/State/composer.json b/src/State/composer.json index 591b1e72e4..87940754b9 100644 --- a/src/State/composer.json +++ b/src/State/composer.json @@ -38,7 +38,7 @@ "require-dev": { "api-platform/serializer": "^4.2.4", "api-platform/validator": "^4.2.4", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/http-foundation": "^6.4.14 || ^7.0 || ^8.0", "symfony/object-mapper": "^7.4 || ^8.0", "symfony/type-info": "^7.4 || ^8.0", @@ -90,11 +90,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Symfony/composer.json b/src/Symfony/composer.json index ecacfbe38c..1d6b64d322 100644 --- a/src/Symfony/composer.json +++ b/src/Symfony/composer.json @@ -55,7 +55,7 @@ "api-platform/graphql": "^4.2.3", "api-platform/hal": "^4.2.3", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/expression-language": "^6.4 || ^7.0 || ^8.0", "symfony/intl": "^6.4 || ^7.0 || ^8.0", "symfony/mercure-bundle": "*", @@ -119,11 +119,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } diff --git a/src/Validator/composer.json b/src/Validator/composer.json index 90b160b1c2..6d89e87c5a 100644 --- a/src/Validator/composer.json +++ b/src/Validator/composer.json @@ -32,7 +32,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { @@ -66,11 +66,5 @@ }, "scripts": { "test": "./vendor/bin/phpunit" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/soyuka/phpunit" - } - ] + } } From 7ef32af2f5d16ad9f23b539c0eccaad7c22dc9f0 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:09:48 +0100 Subject: [PATCH 02/12] moving mongodb req --- composer.json | 3 - src/Doctrine/Odm/Filter/DateFilter.php | 5 +- .../TestBundle/ApiResource/AgentApi.php | 13 ---- .../ApiResource/AgentDocumentApi.php | 77 +++++++++++++++++++ tests/Fixtures/app/config/config_common.yml | 4 - tests/Fixtures/app/config/config_mongodb.yml | 5 ++ .../QueryParameterStateOptionsTest.php | 9 ++- 7 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php diff --git a/composer.json b/composer.json index 55f0d023d0..f0a3597f33 100644 --- a/composer.json +++ b/composer.json @@ -123,15 +123,12 @@ "willdurand/negotiation": "^3.1" }, "require-dev": { - "ext-mongodb": "^1.21 || ^2.0", "behat/behat": "^3.11", "behat/mink": "^1.9", "doctrine/cache": "^1.11 || ^2.1", "doctrine/common": "^3.2.2", "doctrine/dbal": "^4.0", "doctrine/doctrine-bundle": "^2.11 || ^3.1", - "doctrine/mongodb-odm": "^2.10", - "doctrine/mongodb-odm-bundle": "^5.0", "doctrine/orm": "^2.17 || ^3.0", "elasticsearch/elasticsearch": "^7.17 || ^8.4 || ^9.0", "friends-of-behat/mink-browserkit-driver": "^1.3.1", diff --git a/src/Doctrine/Odm/Filter/DateFilter.php b/src/Doctrine/Odm/Filter/DateFilter.php index 227888c80f..7bc5451d17 100644 --- a/src/Doctrine/Odm/Filter/DateFilter.php +++ b/src/Doctrine/Odm/Filter/DateFilter.php @@ -23,7 +23,6 @@ use ApiPlatform\Metadata\QueryParameter; use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter; use Doctrine\ODM\MongoDB\Aggregation\Builder; -use Doctrine\ODM\MongoDB\Types\Type as MongoDbType; /** * The date filter allows to filter a collection by date intervals. @@ -127,8 +126,8 @@ final class DateFilter extends AbstractFilter implements DateFilterInterface, Js use DateFilterTrait; public const DOCTRINE_DATE_TYPES = [ - MongoDbType::DATE => true, - MongoDbType::DATE_IMMUTABLE => true, + 'date' => true, + 'date_immutable' => true, ]; /** diff --git a/tests/Fixtures/TestBundle/ApiResource/AgentApi.php b/tests/Fixtures/TestBundle/ApiResource/AgentApi.php index 9d040921bb..fc4bca059a 100644 --- a/tests/Fixtures/TestBundle/ApiResource/AgentApi.php +++ b/tests/Fixtures/TestBundle/ApiResource/AgentApi.php @@ -13,15 +13,12 @@ namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResource; -use ApiPlatform\Doctrine\Odm\Filter\DateFilter as OdmDateFilter; -use ApiPlatform\Doctrine\Odm\State\Options as OdmOptions; use ApiPlatform\Doctrine\Orm\Filter\DateFilter; use ApiPlatform\Doctrine\Orm\State\Options; use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\QueryParameter; -use ApiPlatform\Tests\Fixtures\TestBundle\Document\AgentDocument; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Agent; #[ApiFilter(DateFilter::class, properties: ['birthday'], alias: 'app_filter_date')] @@ -34,16 +31,6 @@ ], stateOptions: new Options(entityClass: Agent::class) )] -#[ApiFilter(OdmDateFilter::class, properties: ['birthday'], alias: 'app_filter_date_odm')] -#[ApiResource( - shortName: 'AgentDocument', - operations: [ - new GetCollection(parameters: [ - 'birthday' => new QueryParameter(filter: 'app_filter_date_odm'), - ]), - ], - stateOptions: new OdmOptions(documentClass: AgentDocument::class) -)] class AgentApi { private ?int $id = null; diff --git a/tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php b/tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php new file mode 100644 index 0000000000..5b1470657d --- /dev/null +++ b/tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResource; + +use ApiPlatform\Doctrine\Odm\Filter\DateFilter as OdmDateFilter; +use ApiPlatform\Doctrine\Odm\State\Options as OdmOptions; +use ApiPlatform\Metadata\ApiFilter; +use ApiPlatform\Metadata\ApiResource; +use ApiPlatform\Metadata\GetCollection; +use ApiPlatform\Metadata\QueryParameter; +use ApiPlatform\Tests\Fixtures\TestBundle\Document\AgentDocument; + +#[ApiFilter(OdmDateFilter::class, properties: ['birthday'], alias: 'app_filter_date_odm')] +#[ApiResource( + shortName: 'AgentDocument', + operations: [ + new GetCollection(parameters: [ + 'birthday' => new QueryParameter(filter: 'app_filter_date_odm'), + ]), + ], + stateOptions: new OdmOptions(documentClass: AgentDocument::class) +)] +class AgentDocumentApi +{ + private ?int $id = null; + + private ?string $name = null; + + private ?\DateTimeInterface $birthday = null; + + public function getId(): ?int + { + return $this->id; + } + + public function setId(?int $id): self + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(?string $name): self + { + $this->name = $name; + + return $this; + } + + public function getBirthday(): ?\DateTimeInterface + { + return $this->birthday; + } + + public function setBirthday(?\DateTimeInterface $birthday): self + { + $this->birthday = $birthday; + + return $this; + } +} diff --git a/tests/Fixtures/app/config/config_common.yml b/tests/Fixtures/app/config/config_common.yml index eb58c616ae..fcd716c59f 100644 --- a/tests/Fixtures/app/config/config_common.yml +++ b/tests/Fixtures/app/config/config_common.yml @@ -443,10 +443,6 @@ services: tags: - name: 'api_platform.doctrine.orm.links_handler' - ApiPlatform\Tests\Fixtures\TestBundle\State\ODMLinkHandledDummyLinksHandler: - tags: - - name: 'api_platform.doctrine.odm.links_handler' - ApiPlatform\Tests\Fixtures\TestBundle\Serializer\ErrorNormalizer: arguments: [ '@serializer.normalizer.problem' ] tags: diff --git a/tests/Fixtures/app/config/config_mongodb.yml b/tests/Fixtures/app/config/config_mongodb.yml index f948ea309b..e08b56b667 100644 --- a/tests/Fixtures/app/config/config_mongodb.yml +++ b/tests/Fixtures/app/config/config_mongodb.yml @@ -26,6 +26,7 @@ api_platform: mapping: paths: - '%kernel.project_dir%/../TestBundle/Model' + - '%kernel.project_dir%/../TestBundle/ApiResource/AgentDocumentApi.php' services: app.my_dummy_resource.mongodb.boolean_filter: @@ -177,3 +178,7 @@ services: ApiPlatform\Tests\Fixtures\TestBundle\Filter\QueryParameterOdmFilter: tags: [ 'api_platform.filter' ] + + ApiPlatform\Tests\Fixtures\TestBundle\State\ODMLinkHandledDummyLinksHandler: + tags: + - name: 'api_platform.doctrine.odm.links_handler' diff --git a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php index 408b531062..058867398b 100644 --- a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php +++ b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php @@ -15,6 +15,7 @@ use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\AgentApi; +use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\AgentDocumentApi; use ApiPlatform\Tests\Fixtures\TestBundle\Document\AgentDocument; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Agent; use ApiPlatform\Tests\SetupClassResourcesTrait; @@ -33,7 +34,13 @@ final class QueryParameterStateOptionsTest extends ApiTestCase */ public static function getResources(): array { - return [AgentApi::class]; + $resources = [AgentApi::class]; + + if (class_exists(\Doctrine\ODM\MongoDB\DocumentManager::class)) { + $resources[] = AgentDocumentApi::class; + } + + return $resources; } public function testQueryParameterStateOptions(): void From 4c11805349171810b9fbebb01f0f60e2ce7be385 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:10:37 +0100 Subject: [PATCH 03/12] phpunit warnings --- tests/Functional/Parameters/BooleanFilterTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Functional/Parameters/BooleanFilterTest.php b/tests/Functional/Parameters/BooleanFilterTest.php index 6a2a9e553a..a856ea3379 100644 --- a/tests/Functional/Parameters/BooleanFilterTest.php +++ b/tests/Functional/Parameters/BooleanFilterTest.php @@ -92,9 +92,9 @@ public function testBooleanFilterWithNullAndEmptyValues(string $url): void public static function booleanFilterNullAndEmptyScenariosProvider(): \Generator { yield 'active_null_value' => ['/filtered_boolean_parameters?active=null']; - yield 'active_empty_value' => ['/filtered_boolean_parameters?active=', 3]; + yield 'active_empty_value' => ['/filtered_boolean_parameters?active=']; yield 'enabled_alias_null_value' => ['/filtered_boolean_parameters?enabled=null']; - yield 'enabled_alias_empty_value' => ['/filtered_boolean_parameters?enabled=', 3]; + yield 'enabled_alias_empty_value' => ['/filtered_boolean_parameters?enabled=']; } /** From 28afa7396f05433347195404d70a307a261d2f89 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:21:41 +0100 Subject: [PATCH 04/12] fix(doctrine): null key array --- src/Doctrine/Orm/Filter/ExistsFilter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Doctrine/Orm/Filter/ExistsFilter.php b/src/Doctrine/Orm/Filter/ExistsFilter.php index 7dbb046630..5315473587 100644 --- a/src/Doctrine/Orm/Filter/ExistsFilter.php +++ b/src/Doctrine/Orm/Filter/ExistsFilter.php @@ -135,8 +135,9 @@ public function __construct(?ManagerRegistry $managerRegistry = null, ?LoggerInt public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void { $parameter = $context['parameter'] ?? null; + $propertyKey = $parameter?->getProperty(); - if (null !== ($value = $context['filters'][$parameter?->getProperty()] ?? null)) { + if (null !== $propertyKey && null !== ($value = $context['filters'][$propertyKey] ?? null)) { $this->filterProperty($this->denormalizePropertyName($parameter->getProperty()), $value, $queryBuilder, $queryNameGenerator, $resourceClass, $operation, $context); return; From 20f8fdace923f36dff3b8c77d88dce4d1a8f4459 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:22:33 +0100 Subject: [PATCH 05/12] ci: phpunit 11.5 on php 8.2 --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 495ea2bc77..d2f054b43f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,6 +217,9 @@ jobs: composer global require soyuka/pmu composer global config allow-plugins.soyuka/pmu true --no-interaction composer global link . + - name: Force PHPUnit 11.5 for PHP 8.2 + if: matrix.php == '8.2' + run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: Clear test app cache run: tests/Fixtures/app/console cache:clear --ansi - name: Run PHPUnit tests @@ -304,6 +307,11 @@ jobs: run: | cd $(composer ${{matrix.component}} --cwd) composer update${{ matrix.php.lowest && ' --prefer-lowest --prefer-source' || '' }}${{ matrix.php.minimal-changes && ' --minimal-changes' || '' }} + - name: Force PHPUnit 11.5 for PHP 8.2 + if: matrix.php.version == '8.2' + run: | + cd $(composer ${{matrix.component}} --cwd) + composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: Run ${{ matrix.component }} tests run: | mkdir -p /tmp/build/logs/phpunit @@ -425,6 +433,9 @@ jobs: composer global require soyuka/pmu composer global config allow-plugins.soyuka/pmu true --no-interaction composer global link . + - name: Force PHPUnit 11.5 for PHP 8.2 + if: matrix.php == '8.2' + run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: Clear test app cache run: tests/Fixtures/app/console cache:clear --ansi - name: Run Behat tests (PHP ${{ matrix.php }}) @@ -1377,6 +1388,10 @@ jobs: composer global config allow-plugins.soyuka/pmu true --no-interaction composer global link . --permanent composer api-platform/laravel update + - name: Force PHPUnit 11.5 for PHP 8.2 + if: matrix.php == '8.2' + working-directory: 'src/Laravel' + run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: PHP version tweaks run: | composer run-script build From c5f9efaa0cbf0c4d31a533558daff07ab08b4478 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:22:42 +0100 Subject: [PATCH 06/12] remove unused package --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index f0a3597f33..1df67d8036 100644 --- a/composer.json +++ b/composer.json @@ -125,7 +125,6 @@ "require-dev": { "behat/behat": "^3.11", "behat/mink": "^1.9", - "doctrine/cache": "^1.11 || ^2.1", "doctrine/common": "^3.2.2", "doctrine/dbal": "^4.0", "doctrine/doctrine-bundle": "^2.11 || ^3.1", From 1bf26c2b151b73219777ddd6997a85d56753a758 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 18 Dec 2025 23:28:38 +0100 Subject: [PATCH 07/12] ci: skip mongodb when needed --- .github/workflows/ci.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2f054b43f..f4e0faac00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring ini-values: memory_limit=-1 tools: pecl, composer coverage: none @@ -89,7 +89,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring ini-values: memory_limit=-1 tools: composer coverage: none @@ -200,7 +200,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite coverage: pcov ini-values: memory_limit=-1 - name: Get composer cache directory @@ -291,7 +291,7 @@ jobs: with: php-version: ${{ matrix.php.version }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite ini-values: memory_limit=-1 - name: PMU run: | @@ -376,7 +376,7 @@ jobs: with: php-version: ${{ matrix.php.version }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite ini-values: memory_limit=-1 - name: Linking run: | @@ -416,7 +416,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite coverage: pcov ini-values: memory_limit=-1 - name: Get composer cache directory @@ -503,7 +503,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_pgsql, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_pgsql coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -554,7 +554,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_mysql, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_mysql coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -836,7 +836,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -889,7 +889,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -929,7 +929,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -968,7 +968,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -1011,7 +1011,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Install additional packages @@ -1059,7 +1059,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -1109,7 +1109,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Get composer cache directory @@ -1153,7 +1153,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, mongodb + extensions: intl, bcmath, curl, openssl, mbstring coverage: none ini-values: memory_limit=-1 - name: Install additional packages @@ -1325,7 +1325,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite ini-values: memory_limit=-1 - name: Setup node uses: actions/setup-node@v4 @@ -1380,7 +1380,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite ini-values: memory_limit=-1 - name: Update project dependencies run: | @@ -1410,7 +1410,7 @@ jobs: with: php-version: 8.4 tools: pecl, composer - extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb + extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite ini-values: memory_limit=-1 - name: Update project dependencies run: | From 263edcba8247a7113f21ff06b7cbee70ae7ac017 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 19 Dec 2025 10:29:31 +0100 Subject: [PATCH 08/12] more mongodb fixes --- src/Doctrine/Odm/PropertyHelperTrait.php | 6 +++--- src/Serializer/Mapping/Loader/PropertyMetadataLoader.php | 6 ++++++ .../{ApiResource => ApiResourceOdm}/AgentDocumentApi.php | 0 tests/Fixtures/app/AppKernel.php | 5 ++++- tests/Fixtures/app/config/config_mongodb.yml | 2 +- .../Parameters/QueryParameterStateOptionsTest.php | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) rename tests/Fixtures/TestBundle/{ApiResource => ApiResourceOdm}/AgentDocumentApi.php (100%) diff --git a/src/Doctrine/Odm/PropertyHelperTrait.php b/src/Doctrine/Odm/PropertyHelperTrait.php index 168e0cec6b..c94220a748 100644 --- a/src/Doctrine/Odm/PropertyHelperTrait.php +++ b/src/Doctrine/Odm/PropertyHelperTrait.php @@ -47,11 +47,11 @@ protected function getClassMetadata(string $resourceClass): ClassMetadata $managerRegistry = $this->getManagerRegistry(); $manager = $managerRegistry?->getManagerForClass($resourceClass); - if ($manager) { - return $manager->getClassMetadata($resourceClass); + if (!$manager) { + throw new InvalidArgumentException(\sprintf('Unable to get class metadata for resource "%s". No object manager found.', $resourceClass)); } - return new MongoDbOdmClassMetadata($resourceClass); + return $manager->getClassMetadata($resourceClass); } /** diff --git a/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php b/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php index 5c25996bdf..408ffdb0c4 100644 --- a/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php +++ b/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php @@ -61,7 +61,13 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool $attributesMetadata = $classMetadata->getAttributesMetadata(); foreach ($refl->getAttributes() as $a) { + // Skip attributes whose classes don't exist (e.g., optional dependencies like MongoDB ODM) + if (!class_exists($a->getName()) && !interface_exists($a->getName())) { + continue; + } + $attribute = $a->newInstance(); + if ($attribute instanceof DiscriminatorMap) { $classMetadata->setClassDiscriminatorMapping(new ClassDiscriminatorMapping( method_exists($attribute, 'getTypeProperty') ? $attribute->getTypeProperty() : $attribute->typeProperty, diff --git a/tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php b/tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php similarity index 100% rename from tests/Fixtures/TestBundle/ApiResource/AgentDocumentApi.php rename to tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php diff --git a/tests/Fixtures/app/AppKernel.php b/tests/Fixtures/app/AppKernel.php index 2a74b0d9b1..a4e7a59508 100644 --- a/tests/Fixtures/app/AppKernel.php +++ b/tests/Fixtures/app/AppKernel.php @@ -314,7 +314,10 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [ if ('mongodb' === $this->environment) { $c->prependExtensionConfig('api_platform', [ 'mapping' => [ - 'paths' => ['%kernel.project_dir%/../TestBundle/Resources/config/api_resources_odm'], + 'paths' => [ + '%kernel.project_dir%/../TestBundle/Resources/config/api_resources_odm', + '%kernel.project_dir%/../TestBundle/ApiResourceOdm', + ], ], ]); diff --git a/tests/Fixtures/app/config/config_mongodb.yml b/tests/Fixtures/app/config/config_mongodb.yml index e08b56b667..40cd1e070b 100644 --- a/tests/Fixtures/app/config/config_mongodb.yml +++ b/tests/Fixtures/app/config/config_mongodb.yml @@ -26,7 +26,7 @@ api_platform: mapping: paths: - '%kernel.project_dir%/../TestBundle/Model' - - '%kernel.project_dir%/../TestBundle/ApiResource/AgentDocumentApi.php' + - '%kernel.project_dir%/../TestBundle/ApiResourceOdm/AgentDocumentApi.php' services: app.my_dummy_resource.mongodb.boolean_filter: diff --git a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php index 058867398b..fc6dcbf16e 100644 --- a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php +++ b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php @@ -15,7 +15,7 @@ use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\AgentApi; -use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\AgentDocumentApi; +use ApiPlatform\Tests\Fixtures\TestBundle\ApiResourceOdm\AgentDocumentApi; use ApiPlatform\Tests\Fixtures\TestBundle\Document\AgentDocument; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Agent; use ApiPlatform\Tests\SetupClassResourcesTrait; From 62981e86dd40a18f82f098efa2747f5fc998d070 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 19 Dec 2025 14:28:48 +0100 Subject: [PATCH 09/12] move odm specific resource --- .../ResourceWithSeparatedDocument.php | 2 +- tests/Fixtures/app/config/config_mongodb.yml | 1 + .../Parameters/QueryParameterStateOptionsTest.php | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) rename tests/Fixtures/TestBundle/{ApiResource => ApiResourceOdm}/ResourceWithSeparatedDocument.php (92%) diff --git a/tests/Fixtures/TestBundle/ApiResource/ResourceWithSeparatedDocument.php b/tests/Fixtures/TestBundle/ApiResourceOdm/ResourceWithSeparatedDocument.php similarity index 92% rename from tests/Fixtures/TestBundle/ApiResource/ResourceWithSeparatedDocument.php rename to tests/Fixtures/TestBundle/ApiResourceOdm/ResourceWithSeparatedDocument.php index bcf1fbc06d..b0e2a6bebb 100644 --- a/tests/Fixtures/TestBundle/ApiResource/ResourceWithSeparatedDocument.php +++ b/tests/Fixtures/TestBundle/ApiResourceOdm/ResourceWithSeparatedDocument.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResource; +namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResourceOdm; use ApiPlatform\Doctrine\Odm\Filter\OrderFilter; use ApiPlatform\Doctrine\Odm\State\Options as ODMOptions; diff --git a/tests/Fixtures/app/config/config_mongodb.yml b/tests/Fixtures/app/config/config_mongodb.yml index 40cd1e070b..119f96888f 100644 --- a/tests/Fixtures/app/config/config_mongodb.yml +++ b/tests/Fixtures/app/config/config_mongodb.yml @@ -27,6 +27,7 @@ api_platform: paths: - '%kernel.project_dir%/../TestBundle/Model' - '%kernel.project_dir%/../TestBundle/ApiResourceOdm/AgentDocumentApi.php' + - '%kernel.project_dir%/../TestBundle/ApiResourceOdm/ResourceWithSeparatedDocument.php' services: app.my_dummy_resource.mongodb.boolean_filter: diff --git a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php index fc6dcbf16e..6c2cdd384e 100644 --- a/tests/Functional/Parameters/QueryParameterStateOptionsTest.php +++ b/tests/Functional/Parameters/QueryParameterStateOptionsTest.php @@ -35,11 +35,11 @@ final class QueryParameterStateOptionsTest extends ApiTestCase public static function getResources(): array { $resources = [AgentApi::class]; - - if (class_exists(\Doctrine\ODM\MongoDB\DocumentManager::class)) { + + if (class_exists(DocumentManager::class)) { $resources[] = AgentDocumentApi::class; } - + return $resources; } From 6e57e9ac21bd4b5325e638867e42b26f9d2f0293 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 19 Dec 2025 14:47:06 +0100 Subject: [PATCH 10/12] wrong namepsc --- tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php b/tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php index 5b1470657d..aea8b646f1 100644 --- a/tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php +++ b/tests/Fixtures/TestBundle/ApiResourceOdm/AgentDocumentApi.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResource; +namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResourceOdm; use ApiPlatform\Doctrine\Odm\Filter\DateFilter as OdmDateFilter; use ApiPlatform\Doctrine\Odm\State\Options as OdmOptions; From 916e3909b581f3668f8beaa91b180d87b62156b6 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 19 Dec 2025 15:07:09 +0100 Subject: [PATCH 11/12] phpstan requires mongodb odm --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e0faac00..dbff7afe91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,6 +149,7 @@ jobs: composer global require soyuka/pmu composer global config allow-plugins.soyuka/pmu true --no-interaction composer global link . + composer require --dev doctrine/mongodb-odm-bundle - name: Cache PHPStan results uses: actions/cache@v4 with: From 4a067d3e77d9d0216128ef7f364cfece59f00b29 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 19 Dec 2025 15:09:01 +0100 Subject: [PATCH 12/12] require phpunit before --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbff7afe91..8abb9e37d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,6 +298,11 @@ jobs: run: | composer global require soyuka/pmu composer global config allow-plugins.soyuka/pmu true --no-interaction + - name: Force PHPUnit 11.5 for PHP 8.2 + if: matrix.php.version == '8.2' + run: | + cd $(composer ${{matrix.component}} --cwd) + composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: Linking if: ${{ !matrix.php.lowest && !matrix.php.minimal-changes }} run: | @@ -308,11 +313,6 @@ jobs: run: | cd $(composer ${{matrix.component}} --cwd) composer update${{ matrix.php.lowest && ' --prefer-lowest --prefer-source' || '' }}${{ matrix.php.minimal-changes && ' --minimal-changes' || '' }} - - name: Force PHPUnit 11.5 for PHP 8.2 - if: matrix.php.version == '8.2' - run: | - cd $(composer ${{matrix.component}} --cwd) - composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies - name: Run ${{ matrix.component }} tests run: | mkdir -p /tmp/build/logs/phpunit