public function testReadAllWithCache()
 {
     $this->io->setIsCacheEnabled(true);
     $this->cache->get(self::ENVIRONMENT_NAME, 'file');
     $expected = array('file' => array('another_key' => 'another_value'), 'only_in_cache' => array('test' => '123'), 'only_in_config' => array('foo' => 'bar'));
     $actual = $this->io->readAll();
     $this->assertEquals($expected, $actual);
 }
Exemplo n.º 2
0
 /**
  * Get the names of all the sections in the configuration
  *
  * @return array Array with the names of of all the sections in the configuration
  */
 public function getAllSections()
 {
     if (!$this->isCacheEnabled()) {
         return $this->configIO->getAllSections();
     }
     $all = $this->cache->get($this->cacheType);
     $sections = array_merge(array_keys($all), $this->configIO->getAllSections());
     $sections = array_unique($sections);
     return array_values($sections);
 }
 /**
  * Sets a translation for the provided locale
  * @param string $localeCode Code of the locale
  * @param string $key Key of the translation
  * @param string $translation
  * @return null
  */
 public function setTranslation($localeCode, $key, $translation)
 {
     $this->io->setTranslation($localeCode, $key, $translation);
     $this->cache->set(self::CACHE_TYPE, $localeCode, null);
 }