From f5aef106cffce6a7b8a50b51a5f650f5e9d3100c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 2 Aug 2023 14:25:51 +0200 Subject: [PATCH] test: fix report_fields_where_declared deprecation (#5710) --- tests/Fixtures/app/AppKernel.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Fixtures/app/AppKernel.php b/tests/Fixtures/app/AppKernel.php index 912edda9104..8b16b6e0e24 100644 --- a/tests/Fixtures/app/AppKernel.php +++ b/tests/Fixtures/app/AppKernel.php @@ -16,6 +16,7 @@ use ApiPlatform\Tests\Fixtures\TestBundle\Document\User as UserDocument; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\User; use ApiPlatform\Tests\Fixtures\TestBundle\TestBundle; +use Doctrine\Bundle\DoctrineBundle\ConnectionFactory; use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; use Doctrine\Bundle\MongoDBBundle\Command\TailCursorDoctrineODMCommand; use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle; @@ -217,6 +218,15 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [ ], ]); + // TODO: remove this check and move this config in config_common.yml when dropping support for DoctrineBundle <2.10 + if (defined(ConnectionFactory::class.'::DEFAULT_SCHEME_MAP')) { + $c->prependExtensionConfig('doctrine', [ + 'orm' => [ + 'report_fields_where_declared' => true, + ], + ]); + } + $loader->load(__DIR__.'/config/config_swagger.php'); if ('mongodb' === $this->environment) {