如何返回模拟方法的参数? [英] How to return the argument of a mocked method?
本文介绍了如何返回模拟方法的参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我该怎么做,以便在PHPUnit中模拟的方法返回其传递的参数?
Hi all how can I make it so in PHPUnit a mocked method returns its passed argument?
例如:
$redirector->expects( $this->once() )->method('gotoUrl')->will( $this->returnValue($argument) );
推荐答案
根据 查看全文