diff --git a/tests/Kernel.php b/tests/Kernel.php index 28b72424..d8f46a1e 100644 --- a/tests/Kernel.php +++ b/tests/Kernel.php @@ -43,12 +43,20 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa if (\defined(ConnectionFactory::class.'::DEFAULT_SCHEME_MAP')) { $container->prependExtensionConfig('doctrine', [ 'orm' => [ - 'report_fields_where_declared' => true, 'validate_xml_mapping' => true, ], ]); } + // doctrine-orm 2.x compatibility + if (class_exists(\Doctrine\Common\Annotations\AnnotationReader::class)) { + $container->prependExtensionConfig('doctrine', [ + 'orm' => [ + 'report_fields_where_declared' => true, + ], + ]); + } + // @phpstan-ignore-next-line if (method_exists(Configuration::class, 'setLazyGhostObjectEnabled') && Kernel::VERSION_ID >= 60100) { $container->prependExtensionConfig('doctrine', [ diff --git a/tests/config/config.yaml b/tests/config/config.yaml index 5302d56e..d45001d7 100644 --- a/tests/config/config.yaml +++ b/tests/config/config.yaml @@ -15,7 +15,6 @@ doctrine: orm: enable_native_lazy_objects: true auto_generate_proxy_classes: false - report_fields_where_declared: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware auto_mapping: true mappings: diff --git a/tests/config/config_old_proxy.yaml b/tests/config/config_old_proxy.yaml index 87de9ee1..e85b70c5 100644 --- a/tests/config/config_old_proxy.yaml +++ b/tests/config/config_old_proxy.yaml @@ -14,7 +14,6 @@ doctrine: dummy_object_id: Meilisearch\Bundle\Tests\Dbal\Type\DummyObjectIdType orm: auto_generate_proxy_classes: true - report_fields_where_declared: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware auto_mapping: true mappings: