Behatch / contexts

Behat extension with most custom helper steps
Other
394 stars 203 forks source link

Fix parameter name on http files #268

Open kevin-verschaeve opened 5 years ago

kevin-verschaeve commented 5 years ago

Hello,

Today I was facing an issue, that I fixed with the code in the PR.

The issue is, that I was not having the same results with an UploadedFile object in test and in dev.

For now, if you add a file in your request like this:

    When I send a POST request to "/upload" with parameters:
      | key    | value                 |
      | file   | @my_real_filename.txt |

In tests, the property $uploadedFile->getClientOriginalName() returns file, and $uploadedFile->getClientOriginalExtension() returns null.

But in dev, same calls returns my_real_filename.txt and txt.

So my feature works in dev, but does not pass tests ...

This come from the originalName of the UploadedFile class.

Let me know if this sounds good or bad to you.

Thanks