Esempio n. 1
0
 /**
  * @test
  * @group library
  */
 public function defaultCodeLengthIsUsedWhenCodeLengthIsNotConfigured()
 {
     $config = Registry::getConfig();
     Registry::setConfig(new \Zend_Config(array()));
     $this->assertEquals(OptinCodeGenerator::DEFAULT_CODE_LENGTH, strlen(OptinCodeGenerator::generate()));
     Registry::setConfig($config);
 }
Esempio n. 2
0
 protected function _initConfig()
 {
     $configOptions = $this->getOptions();
     $config = new Zend_Config($configOptions, true);
     Registry::setConfig($config);
     return $config;
 }
Esempio n. 3
0
 protected function updateConfigModuleEnableDev($enable)
 {
     // set quota in config
     $newConfig = new \Zend_Config(Registry::getConfig()->toArray(), true);
     $newConfig->quota->module->enableDev = $enable;
     $newConfig->setReadOnly();
     Registry::setConfig($newConfig);
 }
 /**
  * @param boolean $enableDev
  */
 protected function setQuotaModuleEnableDev($enableDev)
 {
     $config = Registry::getConfig();
     $newConfig = new \Zend_Config($config->toArray(), true);
     $newConfig->quota->module->enableDev = $enableDev;
     $newConfig->setReadOnly();
     Registry::setConfig($newConfig);
 }
Esempio n. 5
0
 /**
  * @param array $pathToValue
  */
 public static function removeValue(array $pathToValue)
 {
     $config = Registry::getConfig()->toArray();
     if (count($pathToValue) <= 0) {
         $config = array();
     } else {
         $configPart =& $config;
         foreach (array_slice($pathToValue, 0, -1) as $key) {
             if (!array_key_exists($key, $configPart)) {
                 return;
             }
             $configPart =& $configPart[$key];
         }
         unset($configPart[end($pathToValue)]);
     }
     $newConfig = new \Zend_Config($config, true);
     $newConfig->setReadOnly();
     Registry::setConfig($newConfig);
 }