phpunit mock - method does not exist
PHPUnit_Framework_TestCase::getMockBuilder()
only takes one (1) argument, the class name. The methods to mock are ment to be defined via the returned mock builder objects setMethods()
method.
$stub = $this
->getMockBuilder('SomeClass')
->setMethods(['execute'])
->getMock();
See also
- PHPUnit Manual > Test Doubles > Mock Objects
I will leave this as an answer to myself, when i reach this problem again:
The mocked method may not be private.