PHPUnit “Mocked method does not exist.” when using $mock->expects($this->at(…))

前端 未结 7 1458
失恋的感觉
失恋的感觉 2021-02-05 00:56

I\'ve run into a strange issue with PHPUnit mock objects. I have a method that should be called twice, so I\'m using the \"at\" matcher. This works for the first time the method

7条回答
  •  北海茫月
    2021-02-05 01:29

    Are you sure you included MyClass in your test? I have had some undefined method errors when mocking a class/interface without including it.

提交回复
热议问题