test: Load composer autoloader if available

This commit is contained in:
Johannes Meyer 2020-01-21 14:13:51 +01:00
parent eb674509b4
commit 9e1d14666c
1 changed files with 9 additions and 3 deletions

View File

@ -24,9 +24,15 @@ set_include_path(implode(PATH_SEPARATOR, [
get_include_path()
]));
require_once 'Mockery/Loader.php';
$mockeryLoader = new \Mockery\Loader;
$mockeryLoader->register();
$vendorAutoload = $basePath . '/vendor/autoload.php';
if (file_exists($vendorAutoload)) {
require_once $vendorAutoload;
} else {
require_once 'Mockery/Loader.php';
$mockeryLoader = new \Mockery\Loader;
$mockeryLoader->register();
}
require_once($icingaLibPath . '/Test/ClassLoader.php');