From 5cedd472f99b73dd4091f34c543fa6efc13973fc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Mar 2020 10:45:07 +0100 Subject: [PATCH] move setting a working session.save_path to bootstrap, to avoid tons of warnings set it cant by changed after output/headers sent --- api/tests/LoggedInTest.php | 5 ----- doc/phpunit_bootstrap.php | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/tests/LoggedInTest.php b/api/tests/LoggedInTest.php index abc672de8c..0395df39ec 100644 --- a/api/tests/LoggedInTest.php +++ b/api/tests/LoggedInTest.php @@ -125,11 +125,6 @@ abstract class LoggedInTest extends TestCase 'passwd_type' => 'text', ); - if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp')) - { - ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir - } - if(!$info) { $info = array( diff --git a/doc/phpunit_bootstrap.php b/doc/phpunit_bootstrap.php index c8bb3af6e1..f47530790f 100644 --- a/doc/phpunit_bootstrap.php +++ b/doc/phpunit_bootstrap.php @@ -24,6 +24,12 @@ if (!class_exists('\PHPUnit\Framework\TestCase') && class_exists('\PHPUnit_Frame // Needed to let Cache work $GLOBALS['egw_info']['server']['temp_dir'] = '/tmp'; $GLOBALS['egw_info']['server']['install_id'] = 'PHPUnit test'; +// setting a working session.save_path +if (ini_get('session.save_handler') === 'files' && !is_writable(ini_get('session.save_path')) && + is_dir('/tmp') && is_writable('/tmp')) +{ + ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir +} // Symlink api/src/fixtures/apps/* to root foreach(scandir($path=__DIR__.'/../api/tests/fixtures/apps') as $app)