I have a file uploader for which I have written the following test:
$browser->visit('/product/professional-photo-prints')
->attach('photo', __DIR__.'/storage/app/public/testing/test_upload.jpg');
That doesn't upload the file. No error either.
However, when I do this:
$browser->visit('/product/professional-photo-prints')
->tinker();
and once in the Terminal launched by Tinker, when I enter the exact same file uploading command I am using in the test:
$browser->attach('photo', __DIR__.'/storage/app/public/testing/test_upload.jpg');
...it works. I can see my Chrome instance upload the file and all.
I can't figure out for the life of me what could be the difference between that command being run from the test itself, or from Tinker.
Any help would be greatly appreciated. Thank you.
P.S. I am using Laravel 5.5 and Dusk 2.0