【发布时间】:2020-02-17 01:45:42
【问题描述】:
有两个模拟方法 setAsy1 和 setAsy2 返回相同的值。目前我需要调用两次相同的方法函数来设置模拟方法。有什么方法可以通过一个电话进行设置吗?
$transferItemMockf->expects($this->any())
->method('setAsy1')
->willReturn($id);
$transferItemMockf->expects($this->any())
->method('setAsy2')
->willReturn($id);
【问题讨论】:
标签: php mocking phpunit refactoring