Mockery fails with 'Could not load mock … class already exists' when running with --code-coverage
问题 I am trying to mock a class for phpunit. Php unit fails with the error Could not load mock ... class already exists . This is the only test I'm running, so it can't be the case that the class is mocked already. Any suggestion would be appreciated. Here is the error case: namespace Tests\Feature; use Tests\TestCase; class DeactivateACSTest extends TestCase { public function testDeactivateAcs() { $deviceController = \Mockery::mock('overload:App\Http\Controllers\Cloud\DeviceController');