Because we re-use the same container for all requests, shared services are not re-created for subsequent (simulated) requests. In this case the translator still has the old locale when testsing, even though it has changed.
This is a limitation of pimple right now, but maybe we can find a way to fix it.
I don't see any way to "fix" that without introducing a whole lot of complexity. There are known workarounds (like injecting the container instead of the request) and they are just fine for a framework like Silex.
Pimple related, came up here.
Because we re-use the same container for all requests, shared services are not re-created for subsequent (simulated) requests. In this case the
translator
still has the oldlocale
when testsing, even though it has changed.This is a limitation of pimple right now, but maybe we can find a way to fix it.