Skip to content
Snippets Groups Projects
Commit 1adadf36 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #5071 from owncloud/fix-autoloader-master

Fix autoloader regression
parents 535ed836 ceeb22aa
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,7 @@ class Autoloader {
$paths[] = 'private/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
} elseif (strpos($class, 'OC\\') === 0) {
$paths[] = 'private/' . strtolower(str_replace('\\', '/', substr($class, 3)) . '.php');
$paths[] = strtolower(str_replace('\\', '/', substr($class, 3)) . '.php');
} elseif (strpos($class, 'OCP\\') === 0) {
$paths[] = 'public/' . strtolower(str_replace('\\', '/', substr($class, 4)) . '.php');
} elseif (strpos($class, 'OCA\\') === 0) {
......
......@@ -19,11 +19,11 @@ class AutoLoader extends \PHPUnit_Framework_TestCase {
}
public function testLeadingSlashOnClassName() {
$this->assertEquals(array('private/files/storage/local.php'), $this->loader->findClass('\OC\Files\Storage\Local'));
$this->assertEquals(array('private/files/storage/local.php', 'files/storage/local.php'), $this->loader->findClass('\OC\Files\Storage\Local'));
}
public function testNoLeadingSlashOnClassName() {
$this->assertEquals(array('private/files/storage/local.php'), $this->loader->findClass('OC\Files\Storage\Local'));
$this->assertEquals(array('private/files/storage/local.php', 'files/storage/local.php'), $this->loader->findClass('OC\Files\Storage\Local'));
}
public function testLegacyPath() {
......@@ -54,7 +54,7 @@ class AutoLoader extends \PHPUnit_Framework_TestCase {
}
public function testLoadCoreNamespace() {
$this->assertEquals(array('private/foo/bar.php'), $this->loader->findClass('OC\Foo\Bar'));
$this->assertEquals(array('private/foo/bar.php', 'foo/bar.php'), $this->loader->findClass('OC\Foo\Bar'));
}
public function testLoadCore() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment