Skip to content

Commit 144f446

Browse files
Merge pull request #52964 from nextcloud/backport/52951/stable29
[stable29] chore: Add an autoload.php file for tests relying on core class
2 parents 7eaebe1 + f937a00 commit 144f446

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
@@ -8,8 +8,8 @@
88
}
99

1010
require_once __DIR__ . '/../lib/base.php';
11+
require_once __DIR__ . '/autoload.php';
1112

12-
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
1313
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true);
1414

1515
// load all enabled apps

0 commit comments

Comments
 (0)