From 582e11c4baa7d5fbef73d54802320c5986efdb60 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 7 Feb 2018 10:22:53 -0700 Subject: [PATCH] Allow to pass egw_info in when creating session --- api/tests/LoggedInTest.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/api/tests/LoggedInTest.php b/api/tests/LoggedInTest.php index 6a74062592..b0df2254dd 100644 --- a/api/tests/LoggedInTest.php +++ b/api/tests/LoggedInTest.php @@ -108,7 +108,7 @@ abstract class LoggedInTest extends TestCase * @param string $passwd * @param string $domain */ - public static function load_egw($user,$passwd,$domain='default') + public static function load_egw($user,$passwd,$domain='default',$info=array()) { $_REQUEST['domain'] = $domain; $GLOBALS['egw_login_data'] = array( @@ -122,15 +122,19 @@ abstract class LoggedInTest extends TestCase ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir } - $GLOBALS['egw_info'] = array( - 'flags' => array( - 'currentapp' => 'api', - 'noheader' => true, - 'autocreate_session_callback' => __CLASS__ .'::create_session', - 'no_exception_handler' => 'cli', - 'noapi' => false, - ) - ); + if(!$info) + { + $info = array( + 'flags' => array( + 'currentapp' => 'api', + 'noheader' => true, + 'autocreate_session_callback' => __CLASS__ .'::create_session', + 'no_exception_handler' => 'cli', + 'noapi' => false, + ) + ); + } + $GLOBALS['egw_info'] = $info; try {