如何为使用 Laravel 5 中的存储文件系统的端点编写集成测试?

How can I write an integration test for an endpoint that uses the Storage filesystem in Laravel 5?

我有以下 API 端点(为了问题的目的已简化代码):

class TestController{
     public function test(Request $request)
     {
          $this->validate($request, ['picture' => 'required|image']);

          Storage::disk('s3')->put('tests/test.png', file_get_contents($request->file('picture'));

          return 'tests/test.png';
     }

如何在 phpunit 中为这段代码编写集成测试?
我有一个有效的测试,但问题是每次我 运行 phpunit,它都会将文件上传到 Amazon S3。

您可以在 Laravel 中模拟外观,请参阅文档 here