我在with模拟上使用方法以断言该方法是以对象作为参数调用的
Mockery::mock(PaymentRepository::class)
->shouldReceive('removeTripPayments')
->with($trip)
->mock();
哪个失败了,我仍然不知道为什么,但我最关心的是这是否是检查它的正确方法,以及是否有可能显示预期参数与给定参数的不同之处。
1) PaymentServiceTest::test_removing_payments
Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0_PaymentRepository::removeTripPayments(object(Trip)). Either the method was unexpected or its arguments matched no expected argument list for this method
Objects: ( array (
'MyNamespace\Trip' =>
array (
'class' => 'MyNamespace\\Trip',
'properties' =>
array (
),
),
))
白猪掌柜的