/** * Helper method to inject a mock frontend to backend instance * * @param \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend $backend Current backend instance * @return \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface Mock frontend */ protected function setUpMockFrontendOfBackend(\TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend $backend) { $mockCache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend::class, array(), array(), '', false); $mockCache->expects($this->any())->method('getIdentifier')->will($this->returnValue('Testing')); $backend->setCache($mockCache); return $mockCache; }
/** * Removes all cache entries of this cache. * * @return void */ public function flush() { exec(PATH_site . self::CMD); parent::flush(); }
/** * Constructs this backend * * @param string $context FLOW3's application context * @param array $options Configuration options - depends on the actual backend */ public function __construct($context, array $options = []) { parent::__construct($context, $options); $this->configuration = GeneralUtility::makeInstance(Configuration::class); }