diff --git a/Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php b/Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php index 69ab069..7fba5b1 100644 --- a/Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php +++ b/Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php @@ -4,6 +4,8 @@ namespace Doctrine\Bundle\MigrationsBundle\Tests\DependencyInjection; +use Composer\InstalledVersions; +use Composer\Semver\VersionParser; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheCompatibilityPass; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; use Doctrine\Bundle\DoctrineBundle\Registry; @@ -285,6 +287,10 @@ public function testPrefersEntityManagerOverConnection(): void 'migrations_paths' => ['DoctrineMigrationsTest' => 'a'], ]; $ormConfig = trait_exists(LazyGhostTrait::class) ? ['enable_lazy_ghost_objects' => true] : []; + if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/doctrine-bundle', '^2.7.1 ')) { + $ormConfig['controller_resolver'] = ['auto_mapping' => false]; + } + $container = $this->getContainer($config, null, $ormConfig); $container->compile(); @@ -349,6 +355,10 @@ public function testCustomEntityManager(): void 'acb' => null, ], ]; + if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/doctrine-bundle', '^2.7.1 ')) { + $ormConfig['controller_resolver'] = ['auto_mapping' => false]; + } + if (trait_exists(LazyGhostTrait::class)) { $ormConfig['enable_lazy_ghost_objects'] = true; } diff --git a/composer.json b/composer.json index 337f652..6e1908e 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "doctrine/migrations": "^3.2" }, "require-dev": { + "composer/semver": "^3.0", "phpunit/phpunit": "^8.5|^9.5", "doctrine/coding-standard": "^12", "phpstan/phpstan": "^1.4",