【问题标题】:Phpunit: how to assert that a file is an image? [duplicate]Phpunit:如何断言文件是图像? [复制]
【发布时间】:2017-02-02 20:35:54
【问题描述】:

有没有办法使用phpunit检查特定文件是否为图像?

【问题讨论】:

标签: php image unit-testing phpunit


【解决方案1】:

您可以使用 'mime_content_type' 函数来获取文件的 MIME 类型。然后,例如,您可以断言返回的值等于 'image/png' 或以 'image' 开头。

【讨论】:

  • 成功了,谢谢!
猜你喜欢
  • 1970-01-01
  • 2011-01-28
  • 1970-01-01
  • 2014-03-06
  • 1970-01-01
  • 2018-08-21
  • 2016-09-14
  • 2013-09-05
  • 1970-01-01
相关资源
最近更新 更多