Skip to content

Commit 6e516b1

Browse files
authored
Merge pull request #4826 from nextcloud/backport/4825/stable30
[stable30] fix(tests): use `autoload.php` for unit tests
2 parents e2577de + 1000343 commit 6e516b1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/bootstrap.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
47
* SPDX-FileCopyrightText: 2014-2015 ownCloud, Inc.
58
* SPDX-License-Identifier: AGPL-3.0-or-later
69
*/
10+
11+
use OCP\App\IAppManager;
12+
use OCP\Server;
13+
714
if (!defined('PHPUNIT_RUN')) {
815
define('PHPUNIT_RUN', 1);
916
}
1017

11-
require_once __DIR__.'/../../../lib/base.php';
18+
require_once __DIR__ . '/../../../tests/autoload.php';
19+
20+
Server::get(IAppManager::class)->loadApp('richdocuments');
1221

1322
if (!class_exists('\PHPUnit\Framework\TestCase')) {
1423
require_once('PHPUnit/Autoload.php');
1524
}
16-
\OC_App::loadApp('richdocuments');
17-
OC_Hook::clear();

0 commit comments

Comments
 (0)