Exemplo n.º 1
0
 /**
  * @param string $key
  * @return mixed
  * @throws Exception
  */
 public static function getConfigField($key)
 {
     if (empty(static::$configArray)) {
         Config::init();
     }
     $configField = static::$configArray[$key];
     if ($configField === null) {
         throw new Exception(ErrorMessages::getConfigFieldNotFoundMessage($key));
     }
     return $configField;
 }
Exemplo n.º 2
0
 public function testGetNonExistentConfigValue()
 {
     $this->setExpectedException("Exception", ErrorMessages::getConfigFieldNotFoundMessage("NonExistent"));
     Config::setConfigField("NonExistent", null);
     Config::getConfigField("NonExistent");
 }