【发布时间】:2019-02-06 08:39:25
【问题描述】:
在我的代码中,我使用makeWith 来解决依赖关系。
在我的测试中,我正在创建一个应该通过调用makeWith 在代码中解决的模拟。然而事实并非如此。
App::make('App\Item'); //ok: returns mock
App::makeWith('App\Item', ['name' => 'apple'];//not ok: doesn't return the mock but the class to be used outside the test environment
这是一个错误还是我遗漏了什么?
【问题讨论】:
标签: laravel testing laravel-5.6 mockery