[BUGFIX] Warning in FAL LocalDriverTest
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 1 Nov 2012 19:23:17 +0000 (20:23 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 1 Nov 2012 19:28:31 +0000 (20:28 +0100)
A subfolder without write permissions makes the tearDown in FAL
LocalDriverTest throw a permission denied warning. This is fixed
by resetting the folder to be writable after gathering result
information in the test case.

Change-Id: I1eb9829b39af7ea67076252385e11701d4be3818
Fixes: #42604
Releases: 6.0
Reviewed-on: http://review.typo3.org/16107
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php

index c6eaac7..e2d410e 100644 (file)
@@ -1030,7 +1030,10 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
                mkdir($basedir . '/someForbiddenFolder');
                chmod($basedir . '/someForbiddenFolder', 0);
                clearstatcache();
-               $this->assertEquals(array('r' => FALSE, 'w' => FALSE), $fixture->getFolderPermissions($this->getSimpleFolderMock('/someForbiddenFolder')));
+               $result = $fixture->getFolderPermissions($this->getSimpleFolderMock('/someForbiddenFolder'));
+               // Change permissions back to writable, so the sub-folder can be removed in tearDown
+               chmod($basedir . '/someForbiddenFolder', 0777);
+               $this->assertEquals(array('r' => FALSE, 'w' => FALSE), $result);
        }
 
        /**