8000 minor #42978 Fix non-existent parameter in test.session.listener (jde… · symfony/symfony@c9a6f65 · GitHub
[go: up one dir, main page]

Skip to content

Commit c9a6f65

Browse filesBrowse files
minor #42978 Fix non-existent parameter in test.session.listener (jderusse)
This PR was merged into the 5.4 branch. Discussion ---------- Fix non-existent parameter in test.session.listener | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - The service `test.session.listener` declared in `test.php` uses the `session.storage.options` parameter. But this parameter is defined in the `FrameworkExtension::registerSessionConfiguration` method which is called only when the `session` config is enabled. Has a result, if someone run tests with `session: false` the user get the following exception: > Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a non-existent parameter "session.storage.options". This PR remove the listener when the session is disabled. It also removes the call to `setArgument` that is not needed because this is already the value defined by the service declaration Commits ------- ad3934e Fix non-existent parameter in test.session.listener
2 parents da2c7b8 + ad3934e commit c9a6f65

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,8 @@ public function load(array $configs, ContainerBuilder $container)
326326

327327
$this->sessionConfigEnabled = true;
328328
$this->registerSessionConfiguration($config['session'], $container, $loader);
329-
if (!empty($config['test'])) {
330-
$container->getDefinition('test.session.listener')->setArgument(2, '%session.storage.options%');
331-
}
329+
} elseif (!empty($config['test'])) {
330+
$container->removeDefinition('test.session.listener');
332331
}
333332

334333
if ($this->isConfigEnabled($container, $config['request'])) {

0 commit comments

Comments
 (0)
0