Is there a way to check if a specific file is an image using phpunit?
Asked
Active
Viewed 1,483 times
2
-
Is this you are searching for http://stackoverflow.com/questions/11969211/phpunit-image-download-test ? – Rahul Feb 02 '17 at 12:21
1 Answers
2
You can use 'mime_content_type' function to obtain file's MIME type. Then, for example, you can assert that the returned value is equal to 'image/png' or starts with 'image'.

Vladimir Vasilyev
- 41
- 3