Fix edge case with Doctrine Middleware & early kernel boot#993
Conversation
|
thanks @HypeMC out of curiosity, in which "real world" scenario did you have this edge case? |
|
released in 2.7.3 |
@nikophil Hi, sorry for the late reply. My real world example is a combination of several different features. The second is a router decorator that uses Symfony's translator to generate translated routes. The router caches certain things, so it requires access to the kernel to get the cache directory and environment. If you have a test that boots the kernel in a |
Configuration from the bundle when using Behat and FriendsOfBehat/SymfonyExtension
#1034
This fixes an edge case that occurs when Doctrine requires the
kernelservice (or any other synthetic one) and the kernel is booted beforeResetDatabase::_resetDatabaseBeforeFirstTest().Error example:
This happens because when
ResetDatabaseManagercallsself::bootKernel(), the old kernel is shut down, but a reference to its container (which no longer has thekernelservice) remains. The new container instance is never used because ofConfiguration::isBooted().