fix(tests): use autoload.php for unit tests

Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
Elizabeth Danzberger 2025-06-03 17:13:45 -04:00
parent e1bed90180
commit 42e1445d59
No known key found for this signature in database
GPG key ID: D64CE07FD0188C79

View file

@ -1,17 +1,24 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2014-2015 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
use OCP\App\IAppManager;
use OCP\Server;
if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__ . '/../../../lib/base.php';
require_once __DIR__ . '/../../../tests/autoload.php';
Server::get(IAppManager::class)->loadApp('richdocuments');
if (!class_exists(\PHPUnit\Framework\TestCase::class)) {
require_once('PHPUnit/Autoload.php');
}
\OC_App::loadApp('richdocuments');
OC_Hook::clear();