silexphp / Silex

[DEPRECATED -- Use Symfony instead] The PHP micro-framework based on the Symfony Components
https://silex.symfony.com
MIT License
3.58k stars 718 forks source link

Container cannot be reset #204

Closed igorw closed 12 years ago

igorw commented 12 years ago

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 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.

fabpot commented 12 years ago

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.