Here is my problem.
I have a test suite that is testing a few classes. My classes all use dependency injection.
I have a class called scheduleHandler that passes all tests. Then my other class ruleHandler has a method that requires an instance of scheduleHandler. I dont want to pass in the real scheduleHandler so I tried to create a mock scheduleHandler to inject in.
The problem I have is that because the scheduleHandler class is tested in the suite above ruleHandler, when the mock is created I get:-
PHP Fatal error: Cannot redeclare class scheduleHandler
If I dont use a test suite, and run the tests individually everything is fine.
Anyone know of a way to get round this ?