I'm actually testing a bundle that I created. All the code is fully unit tested but now, I want to test if my symfony2 services can be request without any trouble.
For that, I need the symfony2 dependency injection container in my test case. How can I do that ?
I recently asked a question similar to this in that I needed just the validator, however the person who replied to my question first had a solution which gave access to the whole container.
Basically you can pick apart WebTestCase
in order to see how it builds the Symfony2 environment and make your own base class which is Symfony aware as it were.
Here is the answer, I hope it helps: Symfony2: Testing entity validation constraints
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With