/**
  * Sets the config file
  */
 protected function setUp()
 {
     $this->configFile = __DIR__ . '/../cache.yml';
     $configLoader = new Loader();
     $config = $configLoader->load($this->configFile);
     $configLoader->setAdapterName($this->adapterType);
     $processedConfiguration = $configLoader->process($this->adapterName, $config);
     $this->config = $processedConfiguration[Config::INDEX_ADAPTER][$this->adapterName];
 }
Example #2
0
 /**
  * Tests that the loader returns the correct array when loading the provided config file
  * and that it is able to process it successfully.
  */
 public function testThatLoaderCanLoadFileAndProcessConfigCorrectly()
 {
     $loader = new Loader();
     $config = $loader->load($this->configFile);
     $loader->setAdapterName($this->adapterType);
     $this->assertArrayHasKey(Config::INDEX_CACHE, $config);
     $this->assertArrayHasKey(Config::INDEX_ADAPTER, $config[Config::INDEX_CACHE]);
     $this->assertArrayHasKey($this->adapterName, $config[Config::INDEX_CACHE][Config::INDEX_ADAPTER]);
     $this->assertArrayHasKey(Config::INDEX_TYPE, $config[Config::INDEX_CACHE][Config::INDEX_ADAPTER][$this->adapterName]);
     $this->assertContains($this->adapterType, $config[Config::INDEX_CACHE][Config::INDEX_ADAPTER][$this->adapterName][Config::INDEX_TYPE]);
     $processedConfig = $loader->process($this->adapterName, $config);
     $this->assertArrayHasKey(Config::INDEX_ADAPTER, $processedConfig);
     $this->assertArrayHasKey($this->adapterName, $processedConfig[Config::INDEX_ADAPTER]);
     $this->assertArrayHasKey(Config::INDEX_TYPE, $processedConfig[Config::INDEX_ADAPTER][$this->adapterName]);
     $this->assertContains($this->adapterType, $processedConfig[Config::INDEX_ADAPTER][$this->adapterName][Config::INDEX_TYPE]);
 }