zenstruck / browser

A fluent interface for your Symfony functional tests.
MIT License
186 stars 17 forks source link

Convert `HttpOptions` files to `UploadedFile`'s #97

Open kbond opened 2 years ago

kbond commented 2 years ago

Currently, uploading files is a bit verbose:

$browser->post('/endpoint', ['files' => [new UploadedFile($realpath, $name, test: true)]);

It would be better if you could do:

$browser->post('/endpoint', ['files' => [$realpath]);

And HttpOptions auto-converts file paths's to UploadedFile's.