Skip to content

Commit c96066b

Browse files
committed
chore(tests): Cleanup bootstrap.php to be forward-compatible
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent e144b0b commit c96066b

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

tests/bootstrap.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
46
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
57
* SPDX-License-Identifier: AGPL-3.0-or-later
68
*/
7-
define('PHPUNIT_RUN', 1);
89

9-
require_once __DIR__ . '/../../../lib/base.php';
10-
require_once __DIR__ . '/../vendor/autoload.php';
10+
use OCP\App\IAppManager;
11+
use OCP\Server;
1112

12-
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/unit/', true);
13+
if (!defined('PHPUNIT_RUN')) {
14+
define('PHPUNIT_RUN', 1);
15+
}
16+
17+
require_once __DIR__ . '/../../../lib/base.php';
18+
require_once __DIR__ . '/../../../tests/autoload.php';
1319

14-
\OC_App::loadApp('circles');
20+
Server::get(IAppManager::class)->loadApp('circles');
1521

1622
OC_Hook::clear();

0 commit comments

Comments
 (0)