Skip to content

Commit

Permalink
Merge pull request #1591
Browse files Browse the repository at this point in the history
2.7.x merge up into 2.8.x
  • Loading branch information
dmaicher authored Dec 8, 2022
2 parents 18a1e5a + fca50a0 commit d127f9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"name": "2.7",
"branchName": "2.7.x",
"slug": "latest",
"slug": "2.7",
"aliases": ["current", "stable"]
},
{
Expand Down
3 changes: 2 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,15 @@ private function addOrmSection(ArrayNodeDefinition $node): void
})
->then(static function ($v) {
$v = (array) $v;
// Key that should not be rewritten to the connection config
// Key that should not be rewritten to the entity-manager config
$excludedKeys = [
'default_entity_manager' => true,
'auto_generate_proxy_classes' => true,
'proxy_dir' => true,
'proxy_namespace' => true,
'resolve_target_entities' => true,
'resolve_target_entity' => true,
'controller_resolver' => true,
];
$entityManager = [];
foreach ($v as $key => $value) {
Expand Down
13 changes: 11 additions & 2 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1291,12 +1291,21 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void
$this->assertArrayNotHasKey('doctrine.middleware', $abstractMiddlewareDefTags);
}

/** @requires function \Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver::__construct */
public function testControllerResolver(): void
/**
* @requires function \Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver::__construct
* @testWith [true]
* [false]
*/
public function testControllerResolver(bool $simpleEntityManagerConfig): void
{
$container = $this->getContainer();
$extension = new DoctrineExtension();
$config = BundleConfigurationBuilder::createBuilderWithBaseValues()->build();

if ($simpleEntityManagerConfig) {
$config['orm'] = [];
}

$extension->load([$config], $container);

$controllerResolver = $container->getDefinition('doctrine.orm.entity_value_resolver');
Expand Down

0 comments on commit d127f9a

Please sign in to comment.