Skip to content

Commit 4479e12

Browse files
committed
Address deprecation from DoctrineBundle
The deprecation can only be addressed for recent enough versions of the bundle, which are quite hard to detect.
1 parent 74d3c0f commit 4479e12

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Doctrine\Bundle\MigrationsBundle\Tests\DependencyInjection;
66

7+
use Composer\InstalledVersions;
8+
use Composer\Semver\VersionParser;
79
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheCompatibilityPass;
810
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
911
use Doctrine\Bundle\DoctrineBundle\Registry;
@@ -285,6 +287,10 @@ public function testPrefersEntityManagerOverConnection(): void
285287
'migrations_paths' => ['DoctrineMigrationsTest' => 'a'],
286288
];
287289
$ormConfig = trait_exists(LazyGhostTrait::class) ? ['enable_lazy_ghost_objects' => true] : [];
290+
if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/doctrine-bundle', '^2.7.1 ')) {
291+
$ormConfig['controller_resolver'] = ['auto_mapping' => false];
292+
}
293+
288294
$container = $this->getContainer($config, null, $ormConfig);
289295

290296
$container->compile();
@@ -349,6 +355,10 @@ public function testCustomEntityManager(): void
349355
'acb' => null,
350356
],
351357
];
358+
if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/doctrine-bundle', '^2.7.1 ')) {
359+
$ormConfig['controller_resolver'] = ['auto_mapping' => false];
360+
}
361+
352362
if (trait_exists(LazyGhostTrait::class)) {
353363
$ormConfig['enable_lazy_ghost_objects'] = true;
354364
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"doctrine/migrations": "^3.2"
2828
},
2929
"require-dev": {
30+
"composer/semver": "^3.0",
3031
"phpunit/phpunit": "^8.5|^9.5",
3132
"doctrine/coding-standard": "^12",
3233
"phpstan/phpstan": "^1.4",

0 commit comments

Comments
 (0)