ZF-6887: MimeTypeTest.php test failures

Issue Type: Unit Tests: Problem Created: 2009-06-02T14:50:59.000+0000 Last Updated: 2009-06-10T07:26:00.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Simon Westcott (swestcott) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate_File

Related issues: Attachments: - patch2.txt


MimeTypeTest::testBasic() on trunk is failing on 32bit Ubuntu.

  1. Zend_Validate_File_MimeTypeTest::testBasic Test expected true with 'image/jpg' Messages: array ( 'fileMimeTypeFalse' => 'The file \'picture.jpg\' has a false mimetype of \'image/jpeg\'', ) Failed asserting that matches expected .

After checking the test file, it appears the mime type is reported as jpeg, not jpg as expected in the test

$ file tests/Zend/Validate/File/_files/picture.jpg tests/Zend/Validate/File/_files/picture.jpg: JPEG image data, JFIF standard 1.01


Posted by Simon Westcott (swestcott) on 2009-06-02T14:52:43.000+0000

Suggested change to fix unit test.

Posted by Thomas Weidner (thomas) on 2009-06-02T23:15:28.000+0000

This change breaks unittests on Windows.

You have to note that the mimetype is given by FileInfo or mimetype. There are several versions available and not all of them give the same result.

Your suggested patch can therefor not be applied.

Posted by Thomas Weidner (thomas) on 2009-06-10T07:25:53.000+0000

Fixed with r15979

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.