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 750818397fbd41c085c7ad270f712b894cfc47bb
16 changes: 13 additions & 3 deletions tests/unit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
<?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;
use PHPUnit\Framework\TestCase;

if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}

require_once __DIR__ . '/../../../../lib/base.php';
\OC::$loader->addValidRoot(\OC::$SERVERROOT . '/tests');
\OC_App::loadApp('user_saml');
if (!class_exists(\PHPUnit\Framework\TestCase::class)) {
require_once __DIR__ . '/../../../../tests/autoload.php';

Server::get(IAppManager::class)->loadApp('user_saml');

if (!class_exists(TestCase::class)) {
require_once('PHPUnit/Autoload.php');
}

OC_Hook::clear();