This short lesson is about a rarely used assertion for file downloads.
In the Controller, you have a method where the response is to download a file.
use Symfony\Component\HttpFoundation\BinaryFileResponse; class ProductController extends Controller{ // ... public function download(): BinaryFileResponse { return response()->download(storage_path('files/product-specification.pdf')); }}
How can you test if this download was successful and if the download returned that exact file name to the browser?
In the test, you can assert the...
No comments yet…