0

i want create a test case for test upload file. it must use my file to test. because i want test upload file excel and import data from this file,after that, check this data from database. i tried:

$response = $this->postJson('api/unit/'.$unit->id.'/import',['file' =>Storage::get('file/file.xlsx')]);
$response->assertJsonFragment(['a'=>'b']);

but it is not working, beacuse when i check $request->all() in my controller, it return null. Please help!

The Manh Nguyen
  • 406
  • 6
  • 19

0 Answers0