I am using this is a Form service.
$files = Input::file('my_file');
I'm trying to test it, but I can't seem to properly mock Input. The docs say not to mock the Request facade. There is no mention of the Input facade, even though they both point to the same class in the IOC container.
I've tried several methods, but they don't work. Any ideas?
$mockInput = Mockery::mock('\Illuminate\Http\Request');
$mockInput->shouldReceive('file')->andReturn($my_test_data);
Input::swap($mockInput);
and
Input::shouldReceive('file')->andReturn($my_test_data);
Apparently, I was wrong. This does work. It does help to have it in the right test.
Also, I created an UploadedFile object and andReturned it: