I have a symfony2 application and I am using phpunit.
I have several unit tests in which I use mocks to mock AppKernel and functional tests that make "real" requests to the application. When performing single tests or only in functional tests, everything works fine.
This is unpleasant when I want to run all the tests at once. Once the final tests are complete, phpunit stops telling me:
Fatal error: Cannot redeclare class AppKernel in C:\Users\sebastian\workspace\ppInterface\app\AppKernel.php on line 35
I do not understand this, because I thought that phpunit would run each test in its own environment. This does not seem to be the case. What can I do to ensure that everything is in order and "reset" the environment in which the tests were run?
source share