From 77a7d538f553e7426552664a5108020de4697d4d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Mar 2020 10:29:53 +0100 Subject: [PATCH] fix conflict with lang() function, by just instanciating setup class --- api/tests/CalDAVTest.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/api/tests/CalDAVTest.php b/api/tests/CalDAVTest.php index a0e01cb971..ffb32ff5fc 100644 --- a/api/tests/CalDAVTest.php +++ b/api/tests/CalDAVTest.php @@ -217,14 +217,29 @@ abstract class CalDAVTest extends TestCase */ private static function getSetup() { - if (!isset($_REQUEST['domain'])) + static $setup=null; + if (!isset($setup)) { - $_REQUEST['domain'] = $GLOBALS['EGW_DOMAIN'] ?? 'default'; - } - $_REQUEST['ConfigDomain'] = $_REQUEST['domain']; - require_once __DIR__.'/../../setup/inc/functions.inc.php'; + if (!isset($_REQUEST['domain'])) + { + $_REQUEST['domain'] = $GLOBALS['EGW_DOMAIN'] ?? 'default'; + } + $_REQUEST['ConfigDomain'] = $_REQUEST['domain']; - return $GLOBALS['egw_setup']; + $GLOBALS['egw_info'] = array( + 'flags' => array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'setup', + 'noapi' => True + )); + if (file_exists(__DIR__ . '/../../header.inc.php')) + { + include_once(__DIR__ . '/../../header.inc.php'); + } + $setup = new \setup(); + } + return $setup; } /**