Browse Source

Fix MimeTypeTest

Joseph Bielawski 14 years ago
parent
commit
25c25ab4b1

+ 7 - 2
tests/Symfony/Tests/Component/HttpFoundation/File/MimeType/MimeTypeTest.php

@@ -82,12 +82,17 @@ class MimeTypeTest extends \PHPUnit_Framework_TestCase
         if (strstr(PHP_OS, 'WIN')) {
             $this->markTestSkipped('Can not verify chmod operations on Windows');
         }
+
         $path = __DIR__.'/../Fixtures/to_delete';
         touch($path);
         chmod($path, 0333);
 
-        $this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException');
-        MimeTypeGuesser::getInstance()->guess($path);
+        if (substr(sprintf('%o', fileperms($path)), -4) == '0333') {
+            $this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException');
+            MimeTypeGuesser::getInstance()->guess($path);
+        } else {
+            $this->markTestSkipped('Can not verify chmod operations, change of file permissions failed');
+        }
     }
 
     public static function tearDownAfterClass()