I have a symfony2 application and I'm using phpunit.
I have some unit tests where I use mocks to mock the AppKernel and functional tests which make "real" requests to the application. When running the unit tests or the functional tests alone, everything works fine.
It get's nasty when I want to run all tests at once. As soon as the unit tests are finished, phpunit stops, telling me:
Fatal error: Cannot redeclare class AppKernel in C:\Users\sebastian\workspace\ppInterface\app\AppKernel.php on line 35
I don't understand this, as I thought phpunit would run each test within it's own environment. This seems to be not the case. What can I do to get things right and "reset" the environment in which the tests run?