Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $environment = $container->getParameter("kernel.environment");
     //Load needed helpers
     $this->loadSymfonyValidator();
     $this->loadConfigurationFactory();
     /*
      * Load Implementations
      */
     foreach (static::$availableImplementations as $implementation) {
         if (isset($config[$implementation]["servers"])) {
             $this->configurationFactory->factoryImplementationConfiguration($implementation, $config, $container);
         }
     }
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.yml');
     //Loading dev services if dev or test
     if ($environment == "dev" || $environment == "test") {
         $loader->load('services_dev.yml');
     }
 }
 /**
  * @code
  * phpunit -v --filter testBadValidationOfServerDefinitionValues -c app/ vendor/urodoz/cachemanager/Urodoz/Bundle/CacheBundle/Tests/Service/ConfigurationFactoryTest.php
  * @endcode
  * @dataProvider providerBadServerDefinitions
  * @expectedException Urodoz\Bundle\CacheBundle\Exception\BadConfigurationException
  */
 public function testBadValidationOfServerDefinitionValues($serverDefinition)
 {
     $container = $this->buildAndMarkSkippedCacheServersUndefined();
     $confFactory = new ConfigurationFactory($container->get("validator"));
     $confFactory->factoryImplementationConfiguration("memcache", array("memcache" => array("servers" => array($serverDefinition))), new ContainerBuilder());
 }