if($appPath === false) { | if($appPath === false) { | ||||
continue; | continue; | ||||
} | } | ||||
\OC::$loader->addValidRoot($appPath); | |||||
\OC_App::registerAutoloading($app, $appPath); | |||||
$file = $appPath . '/appinfo/register_command.php'; | $file = $appPath . '/appinfo/register_command.php'; | ||||
if (file_exists($file)) { | if (file_exists($file)) { | ||||
require $file; | require $file; |
} | } | ||||
//run appinfo/install.php | //run appinfo/install.php | ||||
\OC::$loader->addValidRoot($appPath); | |||||
\OC_App::registerAutoloading($app, $appPath); | |||||
self::includeAppScript("$appPath/appinfo/install.php"); | self::includeAppScript("$appPath/appinfo/install.php"); | ||||
$info = OC_App::getAppInfo($app); | $info = OC_App::getAppInfo($app); |
} | } | ||||
/** | /** | ||||
* @internal | |||||
* @param string $app | * @param string $app | ||||
* @param string $path | * @param string $path | ||||
*/ | */ | ||||
protected static function registerAutoloading($app, $path) { | |||||
public static function registerAutoloading($app, $path) { | |||||
// Register on PSR-4 composer autoloader | // Register on PSR-4 composer autoloader | ||||
$appNamespace = \OC\AppFramework\App::buildAppNamespace($app); | $appNamespace = \OC\AppFramework\App::buildAppNamespace($app); | ||||
\OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); | \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); |
public function testStartMigrationSuccessful() { | public function testStartMigrationSuccessful() { | ||||
// we need to be able to autoload the class we're mocking | // we need to be able to autoload the class we're mocking | ||||
\OC::$loader->addValidRoot(\OC_App::getAppPath('encryption')); | |||||
\OC_App::registerAutoloading('encryption', \OC_App::getAppPath('encryption')); | |||||
$migration = $this->getMockBuilder('\\OCA\\Encryption\\Migration') | $migration = $this->getMockBuilder('\\OCA\\Encryption\\Migration') | ||||
->disableOriginalConstructor()->getMock(); | ->disableOriginalConstructor()->getMock(); |