title: Laravel phpunit test maatwebsite/excel import
body: <p>I've created an maatwebsite/excel import routine and i would like to test it.</p>
  
  <p>The maatwebsite/excel testing page does not provide me with any other information than to fake it.
  But i need to upload my real excel-file, as i want to validate whether the data from the excel file was processed correctly.</p>
  
  <p>Here's my upload input field and the corresponding button to hit the endpoint <code>/import</code></p>
  
  <pre><code>&lt;form action="/import" method="post" enctype="multipart/form-data"&gt;
     @csrf
     &lt;div class="form-group"&gt;
         &lt;input type="file" class="form-control-file file-path" name="fileToUpload"&gt;
     &lt;/div&gt;
     &lt;button type="submit" class="btn btn-primary"&gt;Import File&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>on the controller side of view, the uploaded file will be processed and imported.</p>
  
  <pre><code>...
  
  public function store(Request $request) {
          $request-&gt;validate([
              'fileToUpload' =&gt; 'required|file|max:4096|mimes:xls,xlsx',
          ]);
  
          // start the import
          Excel::import(new SheetNavigator, request()-&gt;file('fileToUpload'));
  ...
  
  </code></pre>
  
  <p>The file that needs to be imported is located within my testing environment under:</p>
  
  <pre><code>/tests
    /files
      /myexcel.xlsx
  </code></pre>
  
  <pre><code>public function test_user_can_import_file() {
  
          Excel::fake();
  
          $datafile = new UploadedFile(
              base_path('tests/files/myfile.xlsx'),
              'myfile.xlsx',
              'xlsx',
              13071,
              true);
  
          $res = $this-&gt;post('/import', [
              'fileToUpload' =&gt; $datafile
          ]);
  
          // asserting, that everything works..
  
      }
  </code></pre>
  
  <p>I need a test to verify that the upload was successful and that the import-routine was triggered.
  I tried everything, from faking anything to using storages. </p>
  
  <p>I appreciate any kind of help, thank you!</p>
  
  <p>Chris</p>