Skip to content

Commit be19d12

Browse files
Merge pull request #2355 from nextcloud/backport/2352/stable31
[stable31] chore(tests): Cleanup bootstrap.php to be forward-compatible
2 parents 11dd5fe + 716123b commit be19d12

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

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)