From 7e2f8c9430d8ea3975b15b0d663ceb40f13fd22e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 3 Nov 2016 03:06:06 +0100 Subject: [PATCH] test/bootstrap: allow fallback to configdir --- test/bootstrap.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/bootstrap.php b/test/bootstrap.php index b1b9a265..b8d12c7e 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -3,13 +3,25 @@ use Icinga\Application\Cli; call_user_func(function() { + error_reporting(E_ALL | E_STRICT); $testbase = __DIR__; $base = dirname($testbase); + require_once 'Icinga/Application/Cli.php'; require_once $base . '/library/Director/Test/BaseTestCase.php'; - symlink($base, $testbase . '/modules/director'); - Cli::start($testbase, $testbase . '/config') + + if (! file_exists($testbase . '/modules/director')) { + symlink($base, $testbase . '/modules/director'); + } + + if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) { + $configDir = $_SERVER['ICINGAWEB_CONFIGDIR']; + } else { + $configDir = $testbase . '/config'; + } + + Cli::start($testbase, $configDir) ->getModuleManager() ->loadModule('director'); });