Example #1
0
 /**
  * Get entire configurations in application and modules
  *
  * @return array
  */
 public function getConfig()
 {
     if ($this->cache instanceof Cache\CacheInterface && !empty($configs = $this->cache->getConfig())) {
         return $configs;
     }
     $configs = $this->moduleHandler->getModulesConfig();
     foreach ($this->files as $file) {
         $config = (require $file);
         if (!is_array($config)) {
             throw new Exception\RuntimeException(sprintf('The config in "%s" file must be array data type', $file));
         }
         $configs = ArrayUtils::merge($configs, require $file);
     }
     return $this->cleanUp($configs);
 }
Example #2
0
 /**
  * @expectedException \Phalex\Mvc\Exception\RuntimeException
  * @expectedExceptionMessage The view path for module "WrongModuleViewPath" is invalid
  */
 public function testGetModulesConfigWrongViewPath()
 {
     $moduleNames = ['Application', 'WrongModuleViewPath'];
     $moduleMock = new Module($moduleNames, ['./tests/module']);
     $moduleMock->getModulesConfig();
 }