public function testFlushAllWithNoExtension()
 {
     $cache = new FilesystemCache($this->directory, '');
     $this->assertTrue($cache->save('key1', 1));
     $this->assertTrue($cache->save('key2', 2));
     $this->assertTrue($cache->flushAll());
     $this->assertFalse($cache->contains('key1'));
     $this->assertFalse($cache->contains('key2'));
 }
Example #2
0
 /**
  * Clear the cache. Both the doctrine FilesystemCache, as well as twig and thumbnail temp files.
  *
  * @see clearCacheHelper
  *
  */
 public function clearCache()
 {
     $result = array('successfiles' => 0, 'failedfiles' => 0, 'failed' => array(), 'successfolders' => 0, 'failedfolders' => 0, 'log' => '');
     // Clear Doctrine's folder..
     parent::flushAll();
     // Clear our own cache folder..
     $this->clearCacheHelper($this->getDirectory(), '', $result);
     // Clear the thumbs folder..
     $path = dirname(dirname(dirname(__DIR__))) . "/thumbs";
     $this->clearCacheHelper($path, '', $result);
     return $result;
 }