【发布时间】:2013-04-05 07:06:48
【问题描述】:
我的方法有3个参数,但我只想测试arg3,arg1和arg2没关系:
$observer = $this->getMock('SomeObserverClass', array('myMethod'));
$observer->expects($this->once())
->method('myMethod')
->with(null, null, $this->equalTo($arg3));
将它们设置为 null 或 !$this->empty() 不起作用。
方法的签名:
public function myMethod(Integer $arg1, String $arg2, String $arg3) {...}
【问题讨论】: