Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address deprecation from DoctrineBundle #531

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php
Original file line number Diff line number Diff line change
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 ')) {
Copy link
Member Author

@greg0ire greg0ire Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the version at which the option was introduced, not the version at which it was deprecated. See doctrine/DoctrineBundle@71d6411

$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
Original file line number Diff line number Diff line change
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
Loading