I have a base class EvoMockDbUnitTestCase, which creates a MockDB object in setup(), which can be used in testcases then.
The constructor of the DB class calls one of the mocked methods ("query") however already.
So I'd be able to reset the call counts after having setup the mocked object, so that the test cases expectations match.
An alternative approach might be, that a call to expectCallCount() would reset the counters ($call_counts).
This would however interfere for sure with expectAt.
Therefore I think a clean interface to reset any related collected data is required.
Log in to post a comment.