Instantiate Request for Testing
When I need to make a request for a test in which the Class is expecting a \Illuminate\Http\Request I can do this for a file based or non file based request.
/**
* @Then I should be able to upload an image file
*/
public function iShouldBeAbleToUploadAnImageFile()
{
$request = new \Illuminate\Http\Request();
$file = new \Symfony\Component\HttpFoundation\FileBag();
$path = base_path('tests/fixtures/example_profile.jpg');
$originalName = 'example_profile.jpg';
$upload = new \Illuminate\Http\UploadedFile($path, $originalName, null, null, null, true);
$file->set('profile_image', $upload);
$request->files = $file;
$this->repo = new \App\Repositories\ProfileRepository();
$results = $this->repo->uploadUserProfileImage($request);
PHPUnit::assertTrue($results, "Repo did not return true");
PHPUnit::assertTrue(File::exists(public_path('storage/' .