aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-05-19 11:21:55 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2025-05-19 11:21:55 +0200
commitd96db5c80e504a544300d2ed0cc3f4f86c19424b (patch)
tree33db864c8391f708b0ddf085288c6d837f447908
parent924330506504304e52b6c64957ac79bb6bb34436 (diff)
downloadnextcloud-server-fix/cleanup-test-legacy-autoloader.tar.gz
nextcloud-server-fix/cleanup-test-legacy-autoloader.zip
chore: Add an autoload.php file for tests relying on core classfix/cleanup-test-legacy-autoloader
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--tests/autoload.php16
-rw-r--r--tests/bootstrap.php2
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/autoload.php b/tests/autoload.php
new file mode 100644
index 00000000000..05fc3852924
--- /dev/null
+++ b/tests/autoload.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+require_once __DIR__ . '/../lib/base.php';
+
+/**
+ * This is a file that applications can require to be able to autoload the class Test\TestCase from Nextcloud tests
+ */
+
+\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 3fdc6b51fba..655b60f114b 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -12,8 +12,8 @@ if ($configDir) {
}
require_once __DIR__ . '/../lib/base.php';
+require_once __DIR__ . '/autoload.php';
-\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true);
// load all enabled apps