Skip to content

Commit

Permalink
fix issue with controller_resolver option (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Dec 7, 2022
1 parent a75e50d commit 22d53b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,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
9 changes: 8 additions & 1 deletion Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1567,12 +1567,19 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void

/**
* @requires function \Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver::__construct
* @testWith [true]
* [false]
*/
public function testControllerResolver(): void
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 22d53b2

Please sign in to comment.