PHPUnit: stub methods undefined
问题 I must be missing something. I'm trying to stub methods on a class in PHPUnit, but when I invoke the method on the mock object, it tells me that method is undefined. Example class to stub: namespace MyApp; class MyStubClass { public function mrMethod() { // doing stuff } } To stub it, I write: // specifying all getMock() args to disable calling of class __construct() $stub = $this->getMock('MyStubClass', array(), array(), 'MockMyStubClass', false, false, false); $stub->expects($this->any()) -