phpunit avoid constructor arguments for mock

后端 未结 7 1087
有刺的猬
有刺的猬 2021-01-30 08:24

What is the way to avoid phpunit having to call the constructor for a mock object? Otherwise I would need a mock object as constructor argument, another one for that etc. The ap

7条回答
  •  一向
    一向 (楼主)
    2021-01-30 08:43

    Perhaps you need to create a stub to pass in as the constructor argument. Then you can break that chain of mock objects.

提交回复
热议问题