Browse Source

Ensure that mime_content_type exists before calling it

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24729 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob 13 năm trước cách đây
mục cha
commit
f5f0cfa46b

+ 5 - 0
tests/Zend/Validate/File/IsCompressedTest.php

@@ -69,6 +69,11 @@ class Zend_Validate_File_IsCompressedTest extends PHPUnit_Framework_TestCase
                 );
                 );
         }
         }
 
 
+        // Prevent error in the next check
+        if (!function_exists('mime_content_type')) {
+            $this->markTestSkipped('mime_content_type function is not available.');
+        }
+
         // Sometimes mime_content_type() gives application/zip and sometimes 
         // Sometimes mime_content_type() gives application/zip and sometimes 
         // application/x-zip ...
         // application/x-zip ...
         $expectedMimeType = mime_content_type(dirname(__FILE__) . '/_files/test.zip');
         $expectedMimeType = mime_content_type(dirname(__FILE__) . '/_files/test.zip');