title: Laravel: Undefined method fake on Laravel storage facades for file upload testing
body: <p>I am starting to learn TDD by experimenting in Laravel's HTTP test. Here's my test function:</p>
  
  <pre><code>public function testLoginUsingUserDeni() {
      $response = $this-&gt;json('POST', '/api/v1/login', [
              'email' =&gt; 'ramadhanrperdana@gmail.com',
              'password' =&gt; 'secret'
          ]);
      $response
          -&gt;assertStatus(200)
          -&gt;assertJSONStructure($this-&gt;loginSuccessJsonStructure);
  
      return $response-&gt;original['token'];
  }
  
  /**
  * @depends testLoginUsingUserDeni
  */
  public function testGambarBaru($token) {
      Storage::fake('gambar');
      $response = $this-&gt;json('POST', '/api/gambar/baru', [
              'token' =&gt; $token,
              'gambar' =&gt; UploadedFile::fake()-&gt;image('evidence.jpg'),
              'posisi' =&gt; 1
          ]);
      Storage::disk('gambar')-&gt;assertExists('evidence.jpg');
      $response
          -&gt;assertStatus(200)
          -&gt;assertJSONStructure($this-&gt;gambarJsonStructure);
  }
  </code></pre>
  
  <p>But, after running the test I got error like this:</p>
  
  <pre><code>PHPUnit 5.7.11 by Sebastian Bergmann and contributors.
  
  Runtime:       PHP 7.0.13-0ubuntu0.16.04.1
  Configuration: /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/phpunit.xml
  
  ..E.......................................                        42 / 42 (100%)
  
  Time: 2.94 seconds, Memory: 20.00MB
  
  There was 1 error:
  
  1) Tests\Feature\Api\GambarTest::testGambarBaru
  BadMethodCallException: Call to undefined method League\Flysystem\Filesystem::fake
  
  /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/vendor/league/flysystem/src/Plugin/PluggableTrait.php:86
  /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:475
  /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php:328
  /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221
  /home/kromatin/Projects/PJB REMBANG/web-apps/KawistaK3_web/tests/Feature/Api/GambarTest.php:65
  
  ERRORS!
  Tests: 42, Assertions: 313, Errors: 1.
  Script phpunit --color=always --verbose handling the test event returned with error code 2
  </code></pre>
  
  <p>I got error when executing <code>testGambarBaru</code> function, while other functions worked well. That error pointed to the line where I place <code>Storage::fake('gambar');</code>.</p>
  
  <p>The purpose of my test function is to ensure my file upload API works well. I followed Laravel's documentation about testing file upload from this doc: <a href="https://laravel.com/docs/5.4/http-tests#testing-file-uploads" rel="nofollow noreferrer">https://laravel.com/docs/5.4/http-tests#testing-file-uploads</a>. But the result said there is no method called <code>fake</code> in Storage Facade. I've done some search inside vendor directory to find any <code>fake</code> method around Storage facades but I can't find it. I am using Laravel 5.4. Is there something I've missed?</p>