Index: tests/t3lib/t3lib_divTest.php =================================================================== --- tests/t3lib/t3lib_divTest.php (Revision 9901) +++ tests/t3lib/t3lib_divTest.php (Arbeitskopie) @@ -1603,9 +1603,7 @@ * @test */ public function fixPermissionsCorrectlySetsPermissionsToFile() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test file $filename = PATH_site . 'typo3temp/' . uniqid('test_'); @@ -1633,9 +1631,7 @@ * @test */ public function fixPermissionsCorrectlySetsPermissionsToHiddenFile() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test file $filename = PATH_site . 'typo3temp/' . uniqid('.test_'); @@ -1663,9 +1659,7 @@ * @test */ public function fixPermissionsCorrectlySetsPermissionsToDirectory() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test directory $directory = PATH_site . 'typo3temp/' . uniqid('test_'); @@ -1693,9 +1687,7 @@ * @test */ public function fixPermissionsCorrectlySetsPermissionsToHiddenDirectory() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test directory $directory = PATH_site . 'typo3temp/' . uniqid('.test_'); @@ -1723,9 +1715,7 @@ * @test */ public function fixPermissionsCorrectlySetsPermissionsRecursive() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test directory and file structure $baseDirectory = PATH_site . 'typo3temp/' . uniqid('test_'); @@ -1801,9 +1791,7 @@ * @test */ public function fixPermissionsDoesNotSetPermissionsToNotAllowedPath() { - if (TYPO3_OS == 'WIN') { - $this->markTestSkipped('fixPermissions() tests not available on Windows'); - } + $this->fixPermissionsCheckEnvironment(); // Create and prepare test file $filename = PATH_site . 'typo3temp/../typo3temp/' . uniqid('test_'); @@ -1824,6 +1812,19 @@ $this->assertEquals($resultFilePermissions, '0742'); } + /** + * Checks the environment and skips fixPermissions() tests, if not applicable + * + * @return void + */ + private function fixPermissionsCheckEnvironment() { + if (TYPO3_OS == 'WIN') { + $this->markTestSkipped('fixPermissions() tests not available on Windows'); + } + if (!function_exists('posix_getegid')) { + $this->markTestSkipped('Function posix_getegid() not available, fixPermissions() tests skipped'); + } + } /////////////////////////////// // Tests concerning mkdir