Browse Source

No more Test_* files exist, remove autoloading

tags/v9.1.0beta1
Joas Schilling 8 years ago
parent
commit
ffa4633822
No account linked to committer's email address
2 changed files with 1 additions and 9 deletions
  1. 1
    3
      lib/autoloader.php
  2. 0
    6
      tests/lib/autoloader.php

+ 1
- 3
lib/autoloader.php View File

@@ -94,7 +94,7 @@ class Autoloader {
$paths[] = \OC::$CLASSPATH[$class];
/**
* @TODO: Remove this when necessary
* Remove "apps/" from inclusion path for smooth migration to mutli app dir
* Remove "apps/" from inclusion path for smooth migration to multi app dir
*/
if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) {
\OCP\Util::writeLog('core', 'include path for class "' . $class . '" starts with "apps/"', \OCP\Util::DEBUG);
@@ -113,8 +113,6 @@ class Autoloader {
// If not found in the root of the app directory, insert '/lib' after app id and try again.
$paths[] = $appPath . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php');
}
} elseif (strpos($class, 'Test_') === 0) {
$paths[] = \OC::$SERVERROOT . '/tests/lib/' . strtolower(str_replace('_', '/', substr($class, 5)) . '.php');
} elseif (strpos($class, 'Test\\') === 0) {
$paths[] = \OC::$SERVERROOT . '/tests/lib/' . strtolower(str_replace('\\', '/', substr($class, 5)) . '.php');
}

+ 0
- 6
tests/lib/autoloader.php View File

@@ -43,12 +43,6 @@ class AutoLoader extends TestCase {
], $this->loader->findClass('Test\Foo\Bar'));
}

public function testLoadTest() {
$this->assertEquals([
\OC::$SERVERROOT . '/tests/lib/foo/bar.php'
], $this->loader->findClass('Test_Foo_Bar'));
}

public function testLoadCore() {
$this->assertEquals([
\OC::$SERVERROOT . '/lib/private/legacy/foo/bar.php',

Loading…
Cancel
Save