From ad9b5077ad8736cd42d75435503f4616c38d77e1 Mon Sep 17 00:00:00 2001
From: Tobias Liebig <tobias.liebig@typo3.org>
Date: Thu, 3 Aug 2023 22:52:46 +0200
Subject: [PATCH] [BUGFIX] Remove GU::fixPermissionsSetsGroup() test

This test checks lowlevel things like usergroup to
be changed by GeneralUtility::fixPermissions().
Various tests in this area have been disabled on
Windows already. They are problematic in macOS driven
docker as well since macOS heavily messes around with
access rights.
We give up on this now, and reduce the details test
checks of GeneralUtility::fixPermissions() a bit by
removing that test.

Resolves: #101568
Releases: main, 12.4, 11.5
Change-Id: I36e781302285dc1966633723abdc8f15bf84ef06
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80383
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Tests/Unit/Utility/GeneralUtilityTest.php | 23 -------------------
 1 file changed, 23 deletions(-)

diff --git a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
index c47a16cad969..d3cb45cc88e6 100644
--- a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
+++ b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
@@ -2077,29 +2077,6 @@ class GeneralUtilityTest extends UnitTestCase
         self::assertSame($expectation, GeneralUtility::jsonEncodeForJavaScript($value));
     }
 
-    ///////////////////////////////
-    // Tests concerning fixPermissions
-    ///////////////////////////////
-    /**
-     * @test
-     * @requires function posix_getegid
-     */
-    public function fixPermissionsSetsGroup(): void
-    {
-        if (Environment::isWindows()) {
-            self::markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
-        }
-        // Create and prepare test file
-        $filename = $this->getVirtualTestDir() . '/' . StringUtility::getUniqueId('test_');
-        GeneralUtilityFilesystemFixture::writeFileToTypo3tempDir($filename, '42');
-        $currentGroupId = posix_getegid();
-        // Set target group and run method
-        $GLOBALS['TYPO3_CONF_VARS']['SYS']['createGroup'] = $currentGroupId;
-        GeneralUtilityFilesystemFixture::fixPermissions($filename);
-        clearstatcache();
-        self::assertEquals($currentGroupId, filegroup($filename));
-    }
-
     /**
      * @test
      */
-- 
GitLab