Skip to content

Commit d17c564

Browse files
committed
chore: Remove useless legacy autoloader for tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 249e33f commit d17c564

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

lib/autoloader.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ public function findClass(string $class): array {
9595
} catch (AppPathNotFoundException) {
9696
// App not found, ignore
9797
}
98-
} elseif ($class === 'Test\\TestCase') {
99-
// This File is considered public API, so we make sure that the class
100-
// can still be loaded, although the PSR-4 paths have not been loaded.
101-
$paths[] = \OC::$SERVERROOT . '/tests/lib/TestCase.php';
10298
}
10399
return $paths;
104100
}

lib/base.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,6 @@ public static function init(): void {
600600
self::$loader = new \OC\Autoloader([
601601
OC::$SERVERROOT . '/lib/private/legacy',
602602
]);
603-
if (defined('PHPUNIT_RUN')) {
604-
self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
605-
}
606603
spl_autoload_register([self::$loader, 'load']);
607604
$loaderEnd = microtime(true);
608605

tests/lib/AutoLoaderTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ public function testLegacyPath(): void {
2424
], $this->loader->findClass('OC_JSON'));
2525
}
2626

27-
public function testLoadTestTestCase(): void {
28-
$this->assertEquals([
29-
\OC::$SERVERROOT . '/tests/lib/TestCase.php'
30-
], $this->loader->findClass('Test\TestCase'));
31-
}
32-
3327
public function testLoadCore(): void {
3428
$this->assertEquals([
3529
\OC::$SERVERROOT . '/lib/private/legacy/foo/bar.php',

0 commit comments

Comments
 (0)