PHPSpec-检查是否已使用类实例参数调用方法

PHPSpec-检查是否已使用类实例参数调用方法,php,rspec,phpspec,Php,Rspec,Phpspec,我在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中进行了以下测试:

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中的示例的测试

$this->dock(Argument::any())->shouldReturnAnInstanceOf(Bike::class);

你要找的是什么?不知道RSpec,用(1)参数的
是什么意思?任何参数?我认为唯一的改进是:函数it_应该_dock_a_bike(){$bike=new\bike();$this->dock($bike)->shouldReturnAnInstanceOf(bike::class);}@DonCallisto是的,任何参数。