Creating a mock in phpunit without mocking any methods?

前端 未结 5 1746
情深已故
情深已故 2020-12-29 01:53

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

5条回答
  •  -上瘾入骨i
    2020-12-29 02:37

    Or you can just use getMock() directly.

    $mock = $this->getMock('MyClass', null, array(), null, false);

提交回复
热议问题