/** * Tests the clear() method. */ public function testClear() { $fs = new Filesystem(); $cacheDir = $this->getCacheDir(); $fs->mkdir("{$cacheDir}/contao/config"); $this->assertFileExists("{$cacheDir}/contao/config"); $clearer = new ContaoCacheClearer($fs); $clearer->clear($cacheDir); $this->assertFileNotExists("{$cacheDir}/contao/config"); }
/** * Purge the internal cache */ public function purgeInternalCache() { $command = new ContaoCacheClearer(\System::getContainer()->get('filesystem')); $command->clear(\System::getContainer()->getParameter('kernel.cache_dir')); // Add a log entry $this->log('Purged the internal cache', __METHOD__, TL_CRON); }