Tests are failing in Laravel apps when using fake images generated by UploadedFile::fake()->image('image.jpg') as the file will be generated internally by tmpfile() and will be named (E.g.)phpGoZkJ9
Currently, it looks if the path contains the filename, including the dot: phpGoZkJ9.
I changed it to match the full filename after the forward slash /
From my understanding, the $path will always have a forward slash (/) before the filename.
If there's a case where doesn't have a forward slash or uses double backslashes \\ (because Windows),I will happily update my PR to include corresponding scenarios and tests.
I'm wondering why is there a foreach and a check without the extension though.
Can a file have multiple extension without being itself a conversion or a responsive image?
Tests are failing in Laravel apps when using fake images generated by
UploadedFile::fake()->image('image.jpg')
as the file will be generated internally bytmpfile()
and will be named (E.g.)phpGoZkJ9
Currently, it looks if the path contains the filename, including the dot:
phpGoZkJ9.
I changed it to match the full filename after the forward slash
/
From my understanding, the$path
will always have a forward slash (/
) before the filename.If there's a case where doesn't have a forward slash or uses double backslashes
\\
(because Windows),I will happily update my PR to include corresponding scenarios and tests.Thanks!