Skip to content
Snippets Groups Projects
Commit 40d8fec1 authored by Philipp Gampe's avatar Philipp Gampe Committed by Jigal van Hemert
Browse files

[BUGFIX] Fatal error function posix_getgroups is not available

This happens for the mkdirSetsGroupOwnershipOfCreatedDirectory() test in
t3lib_divTest.

Solution, just skip the test if the function does not exists.

Also do same safety check for posix_getegid() as done some tests above.

Change-Id: I18cbebc0b22ae5a7318673ed8abd2bd01003ba57
Fixes: #33718
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/8867
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
parent 6ebb8235
Branches
Tags
No related merge requests found
......@@ -2536,6 +2536,14 @@ class t3lib_divTest extends tx_phpunit_testcase {
* @test
*/
public function mkdirSetsGroupOwnershipOfCreatedDirectory() {
if (!function_exists('posix_getegid')) {
$this->markTestSkipped('Function posix_getegid() not available, mkdirSetsGroupOwnershipOfCreatedDirectory() tests skipped');
}
if (posix_getegid() === -1) {
$this->markTestSkipped(
'The mkdirSetsGroupOwnershipOfCreatedDirectory() is not available on Mac OS because posix_getegid() always returns -1 on Mac OS.'
);
}
$swapGroup = $this->checkGroups(__FUNCTION__);
if ($swapGroup !== FALSE) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
......@@ -2564,6 +2572,9 @@ class t3lib_divTest extends tx_phpunit_testcase {
$this->markTestSkipped($methodName . '() test not available on Windows.');
return FALSE;
}
if (!function_exists('posix_getgroups')) {
$this->markTestSkipped('Function posix_getgroups() not available, ' . $methodName . '() tests skipped');
}
$groups = posix_getgroups();
if (count($groups) <= 1) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment