diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index a7c793ed9bf..701dccc6e63 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -26,8 +26,10 @@ * \remarks Class that extends all PHPunit tests. To share similare code between each test. */ -// Workaround for false security issue with main.inc.php in tests: -$_SERVER['PHP_SELF'] = "phpunit"; +// Workaround for false security issue with main.inc.php on Windows in tests: +if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $_SERVER['PHP_SELF'] = "phpunit"; +} global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver