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 19, 2025
commit 7f2ff8554e5a156dc06b6793008b3940ad9c463c
14 changes: 9 additions & 5 deletions tests/Unit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<?php

declare(strict_types=1);

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

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

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

OC_Hook::clear();
Loading