PHPUnit test case knows symfony2 injection container

I am really testing the bundle that I created. All code is fully tested, but now, I want to check if my symfony2 services can request without problems.

To do this, I need a symfony2 injection container in my test case. How can i do this?

+6
source share
1 answer

I recently asked a question similar to this one in which I only need a validator, however the person who first answered my question had a solution that gave access to the entire container.

Basically, you can highlight WebTestCase to see how it creates a Symfony2 environment and create your own base class, which is known to be Symfony.

Here is the answer, I hope this helps: Symfony2: Entity Authentication Limitations

+5
source

Source: https://habr.com/ru/post/898297/


All Articles