vendredi 19 août 2016

Laravel testing input file array

How I fill a form like this using Laravel's attach() method when writing my tests?

<input type="file" name="photo[]">
<input type="file" name="photo[]">
<input type="file" name="photo[]">

Obviously this won't work:

$this->attach('photo1.jpg', 'photo[]');
$this->attach('photo2.jpg', 'photo[]');
$this->attach('photo3.jpg', 'photo[]');

I did try using fillForm() and submitForm() with no luck.

I've been searching how to solve this, but I can't figure it out.

Any help?

Aucun commentaire:

Enregistrer un commentaire