Level 50
Can't you just do something like :
Storage::shouldReceive('put')->once()->with('/path/thing', $contents);
Whatever is inside your upload code?
Hi,
I'm trying to test my file uploads to s3. At the moment I'm physically hitting s3 which is okay but slow. I don't quite understand how I would go about mocking s3 to avoid that. So, if I'm using Taylor's example in the docs:
public function testPhotoCanBeUploaded()
{
$this->visit('/upload')
->type('File Name', 'name')
->attach($absolutePathToFile, 'photo')
->press('Upload')
->see('Upload Successful!');
}
How do i mock the storage facade so I don't actually upload to s3? I've read the docs but it doesn't click with me.... Thanks
Please or to participate in this conversation.