作者:手机用户2502915433 | 来源:互联网 | 2022-12-11 12:50
1> 小智..:
您可以按照以下文档在单元测试中模拟Log Facade :
public function test_venue_store_failed(){
$venue = new Venue();
Log::shouldReceive('info')
->with('Failed to Save Venue'. $venue);
$venueRepo = new VenueRepository();
$this->withExceptionHandling();
$venueRepo->store($venue);
}