Phpunit createMock() method not found on CircleCI


I’m discovering CircleCI for a Symfony 3 project.

In my tests, I use the createMock() method of phpunit ( to mock objects in my tests.

Apparently, I cannot use it on CircleCI :
PHP Fatal error: Uncaught Error: Call to undefined method MyBundle\Tests\Controller\MyControllerTest::createMock() in ...

Any additional configuration to perform to enable this ?

Thanks a lot


I finally use to handle mocking.
So I no longer call the createMock() method that was not found.

Hope this can help!


Too bad you didn’t find what the problem with PHPUnit’s native createMock() was. I am experiencing the same issue, and I have determined with absolute certainty (using reflection) that my testcase DOES inherit from a base test case class that DOES define the createMock() method, but nonetheless method_exists($this,‘createMock’) returns false in my testcase class. This is an anomaly beyond my understanding - how can a method FAIL to be inherited?