Skip to content

Commit 9dfdf7f

Browse files
committed
This is fine
1 parent 418a6a3 commit 9dfdf7f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Autocomplete/tests/Fixtures/Kernel.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\UX\Autocomplete\Tests\Fixtures;
1313

1414
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
15+
use Doctrine\ORM\Mapping\AssociationMapping;
1516
use Psr\Log\NullLogger;
1617
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1718
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
@@ -100,14 +101,11 @@ protected function configureContainer(ContainerConfigurator $c): void
100101
'auto_refresh_proxies' => false,
101102
]);
102103

103-
$c->extension('doctrine', [
104+
$config = [
104105
'dbal' => ['url' => '%env(resolve:DATABASE_URL)%'],
105106
'orm' => [
106107
'auto_generate_proxy_classes' => true,
107108
'auto_mapping' => true,
108-
'controller_resolver' => [
109-
'auto_mapping' => true,
110-
],
111109
'mappings' => [
112110
'Test' => [
113111
'is_bundle' => false,
@@ -118,7 +116,14 @@ protected function configureContainer(ContainerConfigurator $c): void
118116
],
119117
],
120118
],
121-
]);
119+
];
120+
if (class_exists(AssociationMapping::class)) {
121+
// Doctrine ORM >= 3.0
122+
$config['orm']['controller_resolver'] = [
123+
'auto_mapping' => true,
124+
];
125+
}
126+
$c->extension('doctrine', $config);
122127

123128
$c->extension('security', [
124129
'password_hashers' => [

0 commit comments

Comments
 (0)