是否可以在 Laravel 5.4 中测试文件下载?

Is it possible to test file download in Laravel 5.4?

使用 Laravel 5.4,现在可以轻松测试文件上传:https://laravel.com/docs/5.4/http-tests#testing-file-uploads

有没有办法测试文件下载? 示例:我想检查是否在单击按钮时生成了 CSV。

我没有找到任何相关信息。 Laravel 中关于文件下载测试的最佳实践是什么?

您可以尝试使用此解决方案来检查文件是否在单击按钮时生成

if($request->hasfile('nameOfInput'))
   {
     //your code
   }