Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(tests): Cleanup bootstrap.php to be forward-compatible
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed May 20, 2025
commit 7c7c7cbec0121f0d0a0b9b9a11541c5c1a2abfa3
13 changes: 8 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2016 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';

// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');

// Fix for "Autoload path not allowed: .../firstrunwizard/*.php"
\OC_App::loadApp('firstrunwizard');
Server::get(IAppManager::class)->loadApp('firstrunwizard');

OC_Hook::clear();