Testing standalone bundle - got 'Could not find service "test.service_container".' - PHP symfony
I'm writing a standalone bundle and trying to test it. But got an error:
LogicException: Could not find service "test.service_container". Try updating the "framework.test" config to "true".
I couldn't find anything in the documentation related to this error. How can I fix that?
UPD: I tried obvious solution by creating config/config_test.yml
and even renamed extension to .yaml
but it didn't help, content of the file is:
framework:
test: true
The content of phpunit.xml.dist
(renamed to .txt
due to github limitations):
phpunit.txt
3 Answer:
Can you create a small example application that allows to reproduce your issue?
Sure, you can check out this https://github.com/inspector-apm/inspector-symfony/tree/0b5af59e85766f33fa5045bccc8c1929587bd4d8 and try to launch tests
That's because in 5.3 we unconditionally use the test.service_container
service to get the session.
This has been fixed on 5.4 in https://github.com/symfony/symfony/pull/41530, we might want to backport part of it.
PR welcome!
Read next
- missing v0.3.5 - mimemagic
- go-sqlite3 no such table: json_each C
- Datepicker shows one day behind in Angular 12 - components
- "protected internal" property/method is not skipped - obfuscar
- Zammad email config verification error when using imap folders different than inbox - Ruby zammad
- Unable to import openAPI using file system - Java zaproxy
- vscode Linux: Cannot use `pkg-config` arguments in task.json TypeScript
- Where is the 3-liner embed-demo to copy&paste CM6 within 30 seconds ?? - JavaScript codemirror.next