Skip to content

Commit 1d2f999

Browse files
Merge pull request #961 from nextcloud/fix/cleanup-tests-bootstrap
2 parents d96395f + 6826aac commit 1d2f999

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

tests/unit/bootstrap.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
46
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
57
* SPDX-License-Identifier: AGPL-3.0-or-later
68
*/
79

10+
use OCP\App\IAppManager;
11+
use OCP\Server;
12+
use PHPUnit\Framework\TestCase;
13+
814
if (!defined('PHPUNIT_RUN')) {
915
define('PHPUNIT_RUN', 1);
1016
}
17+
1118
require_once __DIR__ . '/../../../../lib/base.php';
12-
\OC::$loader->addValidRoot(\OC::$SERVERROOT . '/tests');
13-
\OC_App::loadApp('user_saml');
14-
if (!class_exists(\PHPUnit\Framework\TestCase::class)) {
19+
require_once __DIR__ . '/../../../../tests/autoload.php';
20+
21+
Server::get(IAppManager::class)->loadApp('user_saml');
22+
23+
if (!class_exists(TestCase::class)) {
1524
require_once('PHPUnit/Autoload.php');
1625
}
17-
OC_Hook::clear();

0 commit comments

Comments
 (0)