title: Mock file in Storage to download in Laravel
body: <p>Is there a way to mock a file using Laravels <code>Storage::fake()</code> method?</p>
  
  <p>I have used <a href="https://laravel.com/docs/5.7/mocking#storage-fake" rel="noreferrer">https://laravel.com/docs/5.7/mocking#storage-fake</a> as a base for my tests, which works fine for uploads. But my download tests are ugly as I have to run my upload route first every time with a mock upload <code>UploadedFile::fake()-&gt;image('avatar.jpg')</code>. Is there a way to skip that part and mock the file to exist directly in the fake storage system?</p>
  
  <pre><code>public function testAvatarUpload()
  {
      Storage::fake('avatars');
  
      // This is the call I would like to change into a mocked existing uploaded file
      $uploadResponse = $this-&gt;json('POST', '/avatar', [
          'avatar' =&gt; UploadedFile::fake()-&gt;image('avatar.jpg')
      ]);
  
      // Download the first avatar
      $response = $this-&gt;get('/download/avatar/1');
  
      $response-&gt;assertStatus(200);
  }
  </code></pre>