Пример #1
0
 /**
  * Test getting all the modules
  */
 public function testGetModules()
 {
     $moduleManager = new ModuleManager();
     $moduleManager->addModule(new TestModule());
     $modules = $moduleManager->getModules();
     $this->assertTrue(is_array($modules));
     $this->assertArrayHasKey('test', $modules);
 }
Пример #2
0
 public function load($resource, $type = null)
 {
     if (true === $this->loaded) {
         throw new \RuntimeException('Do not add the "app" loader twice');
     }
     foreach ($this->moduleManager->getModules() as $module) {
         $routes = $module->addAdminRoutes($this, $this->routes);
         if ($routes) {
             $requirements = array();
             $routes->addPrefix('/module/' . $module->getId(), array(), $requirements);
             $this->routes->addCollection($routes);
         }
     }
     $this->loaded = true;
     return $this->routes;
 }
 private function createExtension()
 {
     $moduleManager = new ModuleManager();
     $moduleManager->addModule(new TestModule());
     return new CmsAdminExtension($moduleManager);
 }
Пример #4
0
 /**
  * Return all the modules
  *
  * @return \LineStorm\CmsBundle\Module\ModuleInterface[]
  */
 public function getModulesFunction()
 {
     return $this->moduleManager->getModules();
 }