【发布时间】:2018-01-19 15:42:14
【问题描述】:
我有以下 phpunit 模拟:
$this->httpClient->expects($this->at(1))->method('send')
->with($this->isInstanceOf(RequestInterface::class))
->willReturn($responseMock);
因此,“with”函数调用正在检查的“send”方法的参数必须是 RequestInterface 的实例。但是我需要更详细地检查这个参数:
- 必须是 RequestInterface 实例的对象
- 对象的“url”属性需要有一定的值(比如“https://some-domain.com”)
- 并且对象的方法必须是'GET'
我该怎么做?
【问题讨论】: