Skip to content

Commit

Permalink
Merge pull request #531 from greg0ire/address-deprecation
Browse files Browse the repository at this point in the history
Address deprecation from DoctrineBundle
  • Loading branch information
greg0ire committed Mar 25, 2024
2 parents 74d3c0f + 4479e12 commit e60395b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -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",
Expand Down

0 comments on commit e60395b

Please sign in to comment.