我有 Cache mocks 的单元测试。在将 laravel 更新到 6.0 之前它运行良好
更新后,我运行了测试并得到了异常
Mockery\Exception\BadMethodCallException:收到 Mockery_2_Illuminate_Cache_CacheManager::driver(),但未指定预期
Cache::shouldReceive('get')
->once()
->with('table_3_'.config('constants.league.premier').'_'.config('constants.sex.female'))
->andReturn(json_encode([
[
'id' => $team1->id,
'place' => 1
],
[
'id' => $team2->id,
'place' => 8
],
[
'id' => $team3->id,
'place' => 11
],
]));
$this->artisan('passport:transfer');