diff --git a/test/php/TestInit.php b/test/php/TestInit.php deleted file mode 100644 index c8a901256..000000000 --- a/test/php/TestInit.php +++ /dev/null @@ -1,67 +0,0 @@ -registerNamespace('Icinga', $libaryPath . '/Icinga'); - $loader->registerNamespace('Icinga\\Form', $applicationPath . '/forms'); - - - $modules = scandir($modulePath); - - foreach ($modules as $module) { - if ($module === '.' || $module === '..') { - continue; - } - - $baseNs = 'Icinga\\Module\\' . ucfirst($module); - $moduleLibraryPath = $modulePath . '/' . $module . '/library/' . ucfirst($module); - - if (is_dir($moduleLibraryPath)) { - $loader->registerNamespace($baseNs, $moduleLibraryPath); - } - - $moduleTestPath = $modulePath . '/' . $module . '/test'; - if (is_dir($moduleTestPath)) { - $testNs = $baseNs .= '\\Test'; - $loader->registerNamespace($testNs, $moduleTestPath); - } - - $moduleFormPath = $modulePath . '/' . $module . '/application/forms'; - if (is_dir($moduleFormPath)) { - $formNs = $baseNs .= '\\Form'; - $loader->registerNamespace($formNs, $moduleFormPath); - } - } - - $loader->register(); - - require_once 'Zend/Loader/Autoloader.php'; - \Zend_Loader_Autoloader::getInstance(); - - Icinga\Application\Config::$configDir = $configPath; - } -} - -TestInit::bootstrap(); diff --git a/test/php/bootstrap.php b/test/php/bootstrap.php new file mode 100644 index 000000000..413052450 --- /dev/null +++ b/test/php/bootstrap.php @@ -0,0 +1,51 @@ +registerNamespace('Icinga', $libraryPath . '/Icinga'); +$loader->registerNamespace('Icinga\\Form', $applicationPath . '/forms'); + +$modules = scandir($modulePath); +foreach ($modules as $module) { + if ($module === '.' || $module === '..') { + continue; + } + + $moduleNamespace = 'Icinga\\Module\\' . ucfirst($module); + $moduleLibraryPath = $modulePath . '/' . $module . '/library/' . ucfirst($module); + + if (is_dir($moduleLibraryPath)) { + $loader->registerNamespace($moduleNamespace, $moduleLibraryPath); + } + + $moduleTestPath = $modulePath . '/' . $module . '/test'; + if (is_dir($moduleTestPath)) { + $loader->registerNamespace($moduleNamespace . '\\Test', $moduleTestPath); + } + + $moduleFormPath = $modulePath . '/' . $module . '/application/forms'; + if (is_dir($moduleFormPath)) { + $loader->registerNamespace($moduleNamespace . '\\Form', $moduleFormPath); + } +} + +$loader->register(); + +require_once 'Zend/Loader/Autoloader.php'; +\Zend_Loader_Autoloader::getInstance(); + +Icinga\Application\Config::$configDir = $configPath; diff --git a/test/php/phpunit.xml b/test/php/phpunit.xml index 268addce7..6ae11aebb 100644 --- a/test/php/phpunit.xml +++ b/test/php/phpunit.xml @@ -1,5 +1,5 @@ - +