ZF-8321: testSetAndGetMagicFile(Zend_Validate_File_MimeTypeTest) unit tests failure

Issue Type: Unit Tests: Problem Created: 2009-11-17T06:05:02.000+0000 Last Updated: 2009-11-20T11:56:43.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Alexander Veremyev (alexander) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate_File

Related issues: Attachments:


{panel} 1) testSetAndGetMagicFile(Zend_Validate_File_MimeTypeTest) Failed asserting that is true. /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Validate/File/MimeTypeTest.php:171 {panel}


Posted by Alexander Veremyev (alexander) on 2009-11-17T06:23:53.000+0000

testSetAndGetMagicFile expects empty string returned by getMagicFile() method.

But, if any of the following files exists, it used as an initial magic file value. {panel} /usr/share/misc/magic /usr/share/misc/magic.mime /usr/share/misc/magic.mgc /usr/share/mime/magic /usr/share/mime/magic.mime /usr/share/mime/magic.mgc /usr/share/file/magic /usr/share/file/magic.mime /usr/share/file/magic.mgc {panel}

PS getMagicFile() initializes Zend_Validate_File_MimeType::$_magicfile property from the specified list only if 'MAGIC' environment variable not set. But it does nothing if 'MAGIC' env variable is present. Is it correct?

Posted by Matthew Weier O'Phinney (matthew) on 2009-11-17T06:35:10.000+0000

Alex -- I believe this is a problem with Zend Server. I've had similar issues testing. If I specify the path to the magic file, it works fine, but relying on the MAGIC env variable does not.

Posted by Thomas Weidner (thomas) on 2009-11-18T03:40:16.000+0000

I am not using Zend_Server. So there is no way for me to reproduce this behaviour.

Would it work if the test checks is MAGIC is set? And if not set, simply ignore all further tests?

Posted by Thomas Weidner (thomas) on 2009-11-19T06:25:05.000+0000

Should be fixed with r19033. Can you evaluate and give feedback?

Posted by Thomas Weidner (thomas) on 2009-11-20T11:56:43.000+0000

Closing as fixed. Please reopen when it's still buggy.

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.