0
我有一個有趣的問題。執行時...Mockery當使用(Mockery :: on(Closure))時引發NoMatchingExpectationException異常
$lenderMailer->shouldReceive('sendDonationMail')->once();
我的測試通過沒有問題。但是,如果我嘗試:
$lenderMailer->shouldReceive('sendDonationMail')->once()->with(\Mockery::on(function(){
return true;
}));
我得到一個NoMatchingExpectationException。該sendDonationMail方法的簽名是
public function sendDonationMail(Lender $lender, Money $donationAmount)
爲什麼會拋出異常任何想法?
什麼是真正的'sendDonationMail'方法的簽名? –
在問題中添加了簽名。 – rreyes1979