New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FrameworkBundle] KernelTestCase resets internal state on tearDown #45414
Conversation
Did you experience any nasty side effect of this not being reset? Can you add a corresponding test case? |
IMHO it should only have a minimum performance impact, because the name is resolved for every test: symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php Lines 126 to 128 in 53c0f9f
|
It could have a performance impact. That's why I'm asking. Why do you want to reset this property, if everything is fine when it is not reset? |
I have some projects that will perform web tests with different kernel configuration. This can also be the case, if you provide a bundle with optional dependencies that will result in a slightly different service configuration. At the moment, I have to manuell reset the |
Thanks for the explanation, that's what I was missing.
Thank you @core23. |
When using the
KernelTestCase
for multiple different test kernels, theKernelTestCase::$class
is not reseted after the test has finished. All other class variables are set to the initial state, so this change should be a bugfix.