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()
詳細については、こちらを参照してください。