Skip to content

Commit f84142d

Browse files
committed
feat: allow doctrine/doctrine-bundle 3
1 parent f8bdb78 commit f84142d

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

tests/Functional/GeocoderListenerTest.php

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,34 +65,30 @@ public function process(ContainerBuilder $container): void
6565
->setPublic(true);
6666
}
6767
});
68-
if (defined(ConnectionFactory::class.'::DEFAULT_SCHEME_MAP')) {
69-
$kernel->addTestConfig(static function (ContainerBuilder $container) {
70-
71-
$orm = [];
72-
73-
// doctrine-bundle
74-
if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('doctrine/doctrine-bundle')) {
75-
// v2
76-
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
77-
$orm['auto_generate_proxy_classes'] = true;
78-
$orm['report_fields_where_declared'] = true;
79-
$orm['controller_resolver']['auto_mapping'] = true;
80-
}
81-
82-
if (version_compare($doctrineBundleVersion, '2.8.0', '>=') && version_compare($doctrineBundleVersion, '3.0.0', '<')) {
83-
$orm['enable_lazy_ghost_objects'] = true;
84-
}
85-
86-
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '3.1.0', '<')) {
87-
$orm['enable_native_lazy_objects'] = true;
88-
}
68+
69+
$kernel->addTestConfig(static function (ContainerBuilder $container) {
70+
$orm = [];
71+
// doctrine-bundle
72+
if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('doctrine/doctrine-bundle')) {
73+
// v2
74+
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
75+
$orm['auto_generate_proxy_classes'] = true;
76+
$orm['controller_resolver']['auto_mapping'] = true;
77+
}
78+
79+
if (version_compare($doctrineBundleVersion, '2.8.0', '>=') && version_compare($doctrineBundleVersion, '3.0.0', '<')) {
80+
$orm['enable_lazy_ghost_objects'] = true;
8981
}
9082

91-
$container->prependExtensionConfig('doctrine', [
92-
'orm' => $orm,
93-
]);
94-
});
95-
}
83+
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '3.1.0', '<')) {
84+
$orm['enable_native_lazy_objects'] = true;
85+
}
86+
}
87+
$container->prependExtensionConfig('doctrine', [
88+
'orm' => $orm,
89+
]);
90+
});
91+
9692
$kernel->handleOptions($options);
9793

9894
return $kernel;

tests/Functional/config/listener.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ doctrine:
66
driver: pdo_sqlite
77
path: '%kernel.cache_dir%/test.sqlite'
88
orm:
9-
#auto_generate_proxy_classes: true
109
validate_xml_mapping: true
11-
#report_fields_where_declared: true
1210
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
1311
auto_mapping: false
1412

0 commit comments

Comments
 (0)