public function testBuildAppNamespaceInfoXml() { $ns = App::buildAppNamespace('namespacetestapp', 'OCA\\'); $this->assertEquals('OCA\NameSpaceTestApp', $ns); }
/** * Turns an app id into a namespace by convetion. The id is split at the * underscores, all parts are camelcased and reassembled. e.g.: * some_app_id -> OCA\SomeAppId * @param string $appId the app id * @param string $topNamespace the namespace which should be prepended to * the transformed app id, defaults to OCA\ * @return string the starting namespace for the app * @since 8.0.0 */ public static function buildAppNamespace($appId, $topNamespace = 'OCA\\') { return \OC\AppFramework\App::buildAppNamespace($appId, $topNamespace); }
/** * @param string $app * @param string $path */ protected static function registerAutoloading($app, $path) { // Register on PSR-4 composer autoloader $appNamespace = \OC\AppFramework\App::buildAppNamespace($app); \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); if (defined('PHPUNIT_RUN')) { \OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true); } // Register on legacy autoloader \OC::$loader->addValidRoot($path); }