Is there a way to check if a specific file is an image using phpunit?
Asked
Active
Viewed 1,182 times
3
-
Is this you are searching for http://stackoverflow.com/questions/11969211/phpunit-image-download-test ? – Rahul Feb 02 '17 at 12:21
1 Answers
4
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
- 76
- 3