我在RSPEC中进行了以下测试:
it { is_expected.to respond_to(:dock).with(1).argument }
我需要复制这个测试,但是使用phpspec。我的代码如下:
function it_should_dock_a_bike()
{
$bike = new \Bike();
$this->dock($bike)->shouldReturnAnInstanceOf('Bike');
}
这段代码是有效的,当我排除$bike参数时它确实失败了,但是是否有更好的方法来显式地编写类似于rspec中的示例的测试?