Reputation: 6207
I have two different testcases, both puts a mock on a method. Is there a way to clean up mocked objects? Because there are different expectations in the testmethods
Upvotes: 7
Views: 6097
Reputation: 1243
May be you need use Mock::close()
:
...
public function tearDown()
{
Mockery::close();
}
...
Upvotes: 7
Reputation: 35169
Create (or recreate) the mock in a test method itself, rather than trying to re-use a pre-generated object (presumably in some kind of setUp function) if it's not suitable for your needs.
Upvotes: 4