Ejemplo n.º 1
0
 /**
  * Overrides secondary config variables by primary ones
  * 
  * @param ConfigContainer $primary_config Overriding config 
  * @param ConfigContainer $secondary_config Config to be overrided
  * @return \ConfigContainer Merged config
  */
 private static function overrideConfigs(ConfigContainer $primary_config, ConfigContainer $secondary_config)
 {
     $config = new ConfigContainer();
     $config->addSections($secondary_config->getSections());
     foreach ($primary_config->getSections() as $section) {
         if ($config->hasSection($section->getSectionName())) {
             $config->getSection($section->getSectionName())->addVariables($section->getVariables());
         } else {
             $config->addSection($section);
         }
     }
     return $config;
 }
Ejemplo n.º 2
0
 /**
  * @expectedException Exception
  * @covers ConfigContainer::getSection
  */
 public function testGetSectionThrowsExceptionWhenSectionIsNotInConfig()
 {
     $this->object->getSection('non-existent');
 }