When I\'m unit-testing my php code with PHPUnit, I\'m trying to figure out the right way to mock an object without mocking any of its methods.
The problem is that if
You can pass null to setMethods() to avoid mocking any methods. Passing an empty array will mock all methods. The latter is the default value for the methods as you've found.
That being said, I would say the need to do this might point out a flaw in the design of this class. Should this method be made static or moved to another class? If the method doesn't require a completely-constructed instance, it's a sign to me that it might be a utility method that could be made static.