目前我有类似的东西(简化版)
app(ShopifySDK::class)->Order->get($params)
如何模拟此类并检查get()
方法输入?
这是行不通的。
$this->app->bind(ShopifySDK::class, function () {
return Mockery::mock(ShopifySDK::class)
->shouldReceive('Order->get')
->once()
->with([
'status' => 'any',
'updated_at_min' => '2010-01-01T00:00:00+00:00',
'order' => 'updated_at asc',
'limit' => 250,
'page' => 1,
])->getMock();
});
并给出这样的错误
ErrorException : Undefined property: Mockery_1__demeter_d588e5bd79af839e05009e561399d4e0_Order::$Order