public function testAdminFilter()
 {
     $manager = new ModuleManager();
     $contentModule = new ContentModule('content');
     $manager->registerModule($contentModule);
     $manager->registerModule(new AdministrationModule('admin'));
     $manager->registerModule(new SubModule('sub', 'test'));
     $this->assertEquals(array($contentModule), array_values($manager->getContentModules()));
 }
 /**
  * @param FormEvent $event
  */
 public function load(FormEvent $event)
 {
     $data = $event->getData();
     $patterns = $this->getRepo()->findAll();
     foreach ($this->moduleManager->getContentModules() as $module) {
         if (!$module instanceof NodeModuleInterface) {
             continue;
         }
         $data[$this->getModuleId($module->getIdentifier())] = '{title}';
         foreach ($this->moduleManager->getSubmodules($module->getIdentifier()) as $submodule) {
             $data[$this->getModuleId($submodule->getIdentifier())] = '{title}';
         }
     }
     /** @var AliasPattern $pattern */
     foreach ($patterns as $pattern) {
         $data[$this->getModuleId($pattern->getModuleIdentifier())] = $pattern->getPattern();
     }
     $event->setData($data);
 }