From fce8c4224017fcf33f691d67786ebef94d602702 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 10 Jan 2016 21:32:52 +0100 Subject: [PATCH 1/2] OC autoloader is not allowed to load 3rdparty --- lib/base.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 51f4d819ab1..f1ee298a2fc 100644 --- a/lib/base.php +++ b/lib/base.php @@ -488,7 +488,6 @@ class OC { OC::$SERVERROOT . '/settings', OC::$SERVERROOT . '/ocs', OC::$SERVERROOT . '/ocs-provider', - OC::$SERVERROOT . '/3rdparty', OC::$SERVERROOT . '/tests', ]); spl_autoload_register(array(self::$loader, 'load')); From 1a592e574593e79df1e0ed6b418cd880c4a5f7ee Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 10 Jan 2016 21:36:14 +0100 Subject: [PATCH 2/2] Only '/tests' to be autoloaded when running unit tests --- lib/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index f1ee298a2fc..80b1a2bafcd 100644 --- a/lib/base.php +++ b/lib/base.php @@ -488,8 +488,10 @@ class OC { OC::$SERVERROOT . '/settings', OC::$SERVERROOT . '/ocs', OC::$SERVERROOT . '/ocs-provider', - OC::$SERVERROOT . '/tests', ]); + if (defined('PHPUNIT_RUN')) { + self::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); + } spl_autoload_register(array(self::$loader, 'load')); $loaderEnd = microtime(true);