我正在使用PHPUnit进行单元测试我使用模拟对象来测试是否使用正确的参数调用方法.当我只想这样做一次时,这很好用.
$logMock = $this->getMockBuilder('Logger')
->disableOriginalConstructor()
->getMock();
//check if it updates the correct record
$logMock->expects($this->exactly(1))
->method('updateLog')
->with(456, 'some status');
Run Code Online (Sandbox Code Playgroud)
现在,我想测试是否第二次调用updateLog(使用不同的参数).我不知道如何用'with'方法做到这一点.
有人有建议吗?