mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
chore: Remove calls to OC_App in bootstrap.php files for tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
7127ac4b43
commit
956924bdc9
3 changed files with 22 additions and 11 deletions
|
|
@ -1,18 +1,21 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
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('dav');
|
||||
|
||||
OC_Hook::clear();
|
||||
Server::get(IAppManager::class)->loadApp('dav');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\Server;
|
||||
|
||||
define('PHPUNIT_RUN', 1);
|
||||
|
||||
$configDir = getenv('CONFIG_DIR');
|
||||
|
|
@ -18,11 +24,12 @@ 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;
|
||||
}
|
||||
\OC_App::loadApp($file->getFilename());
|
||||
$appManager->loadApp($file->getFilename());
|
||||
}
|
||||
|
||||
OC_Hook::clear();
|
||||
|
|
|
|||
Loading…
Reference in a new issue