title: How to unit test the download file name in Laravel
body: <p>I am developing a Laravel application. I have developed a file download feature in my Controller like this.</p>
  
  <pre><code>public function downloadUsagePdf()
  {
     return Storage::disk('default')-&gt;response('path/to/usage.pdf', 'new-file-name.pdf');
  }
  </code></pre>
  
  <p>As you can see above, I am renaming the file. I like to unit test that the file is rendered with the new name. How can I unit test that? I am not downloading. I am just rendering on the browser first.</p>