test: add env option to disable loading all installed apps during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
+9
-6
@@ -23,13 +23,16 @@ require_once __DIR__ . '/autoload.php';
|
||||
|
||||
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true);
|
||||
|
||||
// load all apps
|
||||
$appManager = Server::get(IAppManager::class);
|
||||
foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
|
||||
if ($file->isDot()) {
|
||||
continue;
|
||||
$dontLoadApps = getenv('TEST_DONT_LOAD_APPS');
|
||||
if (!$dontLoadApps) {
|
||||
// load all apps
|
||||
$appManager = Server::get(IAppManager::class);
|
||||
foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
|
||||
if ($file->isDot()) {
|
||||
continue;
|
||||
}
|
||||
$appManager->loadApp($file->getFilename());
|
||||
}
|
||||
$appManager->loadApp($file->getFilename());
|
||||
}
|
||||
|
||||
OC_Hook::clear();
|
||||
|
||||
Reference in New Issue
Block a user