[BUGFIX] Fix failing tests on OSX Mavericks 71/27271/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 2 Feb 2014 17:40:30 +0000 (18:40 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 2 Feb 2014 18:08:31 +0000 (19:08 +0100)
Resolves: #55603
Releases: 6.2

Change-Id: I27efb6d19f580eba455cde92dd76628f72dce536
Reviewed-on: https://review.typo3.org/27271
Reviewed-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php

index 8ffafa5..089da5d 100644 (file)
@@ -2994,7 +2994,13 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped($methodName . '() test cannot be done when the web server user is only member of 1 group.');
                        return FALSE;
                }
-               $groupInfo = posix_getgrgid($groups[1]);
+               $uname = strtolower(php_uname());
+               $groupOffset = 1;
+               if (strpos($uname, 'darwin') !== FALSE) {
+                       // We are on OSX and it seems that the first group needs to be fetched since Mavericks
+                       $groupOffset = 0;
+               }
+               $groupInfo = posix_getgrgid($groups[$groupOffset]);
                return $groupInfo['name'];
        }