Open kevin-verschaeve opened 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.
UploadedFile
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.
$uploadedFile->getClientOriginalName()
file
$uploadedFile->getClientOriginalExtension()
null
But in dev, same calls returns my_real_filename.txt and txt.
my_real_filename.txt
txt
So my feature works in dev, but does not pass tests ...
This come from the originalName of the UploadedFile class.
originalName
Let me know if this sounds good or bad to you.
Thanks
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:
In tests, the property
$uploadedFile->getClientOriginalName()
returnsfile
, and$uploadedFile->getClientOriginalExtension()
returnsnull
.But in dev, same calls returns
my_real_filename.txt
andtxt
.So my feature works in dev, but does not pass tests ...
This come from the
originalName
of theUploadedFile
class.Let me know if this sounds good or bad to you.
Thanks