You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In the test environment when creating a KernelBrowser a dependency error is thrown:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException : The service "session.storage.mock_file" has a dependency on a non-existent service "session.storage.metadata_bag".
How to reproduce
class SomeTest extends WebTestCase
{
public function testTest(): void
{
$client = self::createClient();
self::assertInstanceOf(KernelBrowser::class, $client);
}
}
Possible Solution
for framework.session.storage_factory_id use session.storage.factory.mock_file instead if session.storage.mock_file
When user provides a framework.session.storage_factory_id, the FrameworkExtension removes some services (like session.storage.metadata_bag), but let the session.storage.mock_file service. (I opened #40285 to fix this). This should not have been an issue, because this service shouldn't have been used and should have been removed. EXCEPT I also made a typo in the flex recipes (fixed by symfony/recipes#905) which configures framework.session.storage_factory_id AND use the session.storage.mock_file service. This is the issue you are facing.
Maker bundle use the flex recipes, that's why I say that the flex PR fixes the issue in maker-bundle
I just reviewed a recent test run in MakerBundle (post #40285 being merged) and it appears the issue is resolved on the PHP 7.4 && 8.x dev tests. The remaining issues on those branches are unrelated to this issue. thanks @jderusse!
Symfony version(s) affected: main
Description
In the
test
environment when creating aKernelBrowser
a dependency error is thrown:How to reproduce
Possible Solution
for
framework.session.storage_factory_id
usesession.storage.factory.mock_file
instead ifsession.storage.mock_file
Additional context
There are a dozen or so tests failing in MakerBundle partly due to this. CI Results -> https://github.com/symfony/maker-bundle/runs/1954376810?check_suite_focus=true. If we need a simple reproducer, I can whip one up based off of one of the failing maker tests.
The text was updated successfully, but these errors were encountered: