public function testCacheFlush()
 {
     $key = 'a';
     $configDatabaseDir = __DIR__;
     $app = new Application();
     $app['debug'] = true;
     $app['testCache'] = new TestCache();
     $loader = new ConfigLoader($app, $configDatabaseDir, '%key%.json', 'testCache');
     $this->assertSame('1:x', $loader->get($key));
     $this->assertSame('1:x', $loader->get($key));
     $loader->flushConfig($key);
     $this->assertSame('2:1', $loader->get($key));
     $this->assertSame('2:1', $loader->get($key));
     $this->assertSame(2, $app['testCache']->getTotalCallCount());
     $this->assertSame(1, $app['testCache']->getTotalFlushCount());
     $loader = new ConfigLoader($app, $configDatabaseDir, '%key%.json', 'testCache');
     $loader->flushConfig($key);
     $this->assertSame('3:2', $loader->get($key));
     $this->assertSame('3:2', $loader->get($key));
     $this->assertSame(3, $app['testCache']->getTotalCallCount());
     $this->assertSame(2, $app['testCache']->getTotalFlushCount());
 }
 /**
  * @expectedException \BadMethodCallException
  * @expectedExceptionMessageRegExp #^"offsetUnset" is not supported.$#
  */
 public function testOffsetUnset()
 {
     $loader = new ConfigLoader(new Application());
     $loader->offsetUnset(1);
 }