Skip to content

Commit 8625b2a

Browse files
Merge pull request #2352 from nextcloud/fix/cleanup-tests-bootstrap
chore(tests): Cleanup bootstrap.php to be forward-compatible
2 parents b06229a + 621155f commit 8625b2a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/Unit/bootstrap.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
37
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
48
* SPDX-License-Identifier: AGPL-3.0-only
59
*/
610

11+
use OCP\App\IAppManager;
12+
use OCP\Server;
13+
714
if (!defined('PHPUNIT_RUN')) {
815
define('PHPUNIT_RUN', 1);
916
}
1017

1118
require_once __DIR__ . '/../../../../lib/base.php';
19+
require_once __DIR__ . '/../../../../tests/autoload.php';
1220

13-
// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
14-
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
15-
16-
// Fix for "Autoload path not allowed: .../notifications/tests/testcase.php"
17-
\OC_App::loadApp('notifications');
18-
19-
OC_Hook::clear();
21+
Server::get(IAppManager::class)->loadApp('notifications');

0 commit comments

Comments
 (0)