Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何使用#phpspec2 接受函数模拟中的所有参数?
例如我有这样的代码:
$em->persist($entity)->willReturn(true);
我不想模拟所有可能的参数,它应该接受每个实体。
您可以使用Argument类和any方法/函数:
Argument
any
use Prophecy\Argument; ... Argument::any()
在这里您可以找到有关此的更多详细信息。