public function testConvertKeysLower()
 {
     $array = array('KEY1' => '1', 'Key2' => '2');
     $keysLowers = array('key1' => '1', 'key2' => '2');
     $response = ArrayUtils::convertKeysLower($array);
     $this->assertEquals($keysLowers, $response);
 }
Beispiel #2
0
 /**
  * Sets the environment and configuration for the chosen mode
  * @param constant $mode
  */
 private function setEnvironment()
 {
     $dirconfig = $this->_dirconfig;
     // Load main config
     $configMainFile = $dirconfig . DIRECTORY_SEPARATOR . self::MAIN_CONFIG;
     if (!file_exists($configMainFile)) {
         throw new Exception('Cannot find config file "' . $configMainFile . '".');
     }
     $config = (include $configMainFile);
     // Load specific config
     $configFile = $dirconfig . DIRECTORY_SEPARATOR . 'mode_' . strtolower($this->_mode) . '.php';
     if (!file_exists($configFile)) {
         throw new Exception('Cannot find config file "' . $configFile . '".');
     }
     $configEnvironment = (include $configFile);
     // Merge config arrays into one
     $this->_config = ArrayUtils::merge($config, $configEnvironment);
 }