Skip to content

Commit b4cec7b

Browse files
authored
Merge pull request #52965 from nextcloud/backport/52951/stable30
[stable30] chore: Add an autoload.php file for tests relying on core class
2 parents ef3b98d + 383ed00 commit b4cec7b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/autoload.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
require_once __DIR__ . '/../lib/base.php';
11+
12+
/**
13+
* This is a file that applications can require to be able to autoload the class Test\TestCase from Nextcloud tests
14+
*/
15+
16+
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
}
1414

1515
require_once __DIR__ . '/../lib/base.php';
16+
require_once __DIR__ . '/autoload.php';
1617

17-
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
1818
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true);
1919

2020
// load all enabled apps

0 commit comments

Comments
 (0)