Laravel - HTTP Tests - Assert Download

Assert that the response is a "download". Typically, this means the invoked route that returned the response returned a Response::download response, BinaryFileResponse, or Storage::download response:

    
    $response->assertDownload();
	

If you wish, you may assert that the downloadable file was assigned a given file name:

    
    $response->assertDownload('image.jpg');