2

Is there a way to check if a specific file is an image using phpunit?

Francesco Borzi
  • 56,083
  • 47
  • 179
  • 252
  • Is this you are searching for http://stackoverflow.com/questions/11969211/phpunit-image-download-test ? – Rahul Feb 02 '17 at 12:21

1 Answers1

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'.