chore: Remove calls to OC_App in bootstrap.php files for tests

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/53893/head
Côme Chilliet 3 months ago
parent 7127ac4b43
commit 956924bdc9
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 13
      apps/dav/tests/unit/bootstrap.php
  2. 11
      apps/user_status/tests/bootstrap.php
  3. 9
      tests/bootstrap.php

@ -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…
Cancel
Save