diff --git a/apps/dav/tests/unit/bootstrap.php b/apps/dav/tests/unit/bootstrap.php index 886a7f0b859..ee76bb6677b 100644 --- a/apps/dav/tests/unit/bootstrap.php +++ b/apps/dav/tests/unit/bootstrap.php @@ -1,18 +1,21 @@ addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); - -\OC_App::loadApp('dav'); - -OC_Hook::clear(); +Server::get(IAppManager::class)->loadApp('dav'); diff --git a/apps/user_status/tests/bootstrap.php b/apps/user_status/tests/bootstrap.php index c24f86c7cbe..c98daca1dfc 100644 --- a/apps/user_status/tests/bootstrap.php +++ b/apps/user_status/tests/bootstrap.php @@ -6,14 +6,15 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + +use OCP\App\IAppManager; +use OCP\Server; + if (!defined('PHPUNIT_RUN')) { define('PHPUNIT_RUN', 1); } require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../../../tests/autoload.php'; -\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); - -\OC_App::loadApp('user_status'); - -OC_Hook::clear(); +Server::get(IAppManager::class)->loadApp('user_status'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3e50e6aef62..81bb930de65 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,16 @@ 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; } - \OC_App::loadApp($file->getFilename()); + $appManager->loadApp($file->getFilename()); } OC_Hook::clear();