TASK: Fix broken tests caused by missing caches

For some reason, which is unknown yet, caches are needed to make tests
pass. We therefore configure the caches to be null.
This commit is contained in:
Daniel Siepmann 2018-04-12 08:26:34 +02:00
parent 97c0485e6f
commit 4234575c36
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -39,14 +39,9 @@ abstract class AbstractUnitTestCase extends CoreTestCase
$this->singletonInstances = GeneralUtility::getSingletonInstances(); $this->singletonInstances = GeneralUtility::getSingletonInstances();
// Disable caching backends to make TYPO3 parts work in unit test mode. // Disable caching backends to make TYPO3 parts work in unit test mode.
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Cache\CacheManager::class \TYPO3\CMS\Core\Cache\CacheManager::class
)->setCacheConfigurations([ )->setCacheConfigurations($this->getCacheConfiguration());
'extbase_object' => [
'backend' => \TYPO3\CMS\Core\Cache\Backend\NullBackend::class,
],
]);
} }
public function tearDown() public function tearDown()
@ -100,4 +95,25 @@ abstract class AbstractUnitTestCase extends CoreTestCase
{ {
return \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 8000000; return \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 8000000;
} }
protected function getCacheConfiguration() : array
{
$cacheConfiguration = [
'extbase_object' => [
'backend' => \TYPO3\CMS\Core\Cache\Backend\NullBackend::class,
],
'cache_runtime' => [
'backend' => \TYPO3\CMS\Core\Cache\Backend\NullBackend::class,
],
];
if (class_exists(\TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class)) {
$cacheConfiguration['fluid_template'] = [
'backend' => \TYPO3\CMS\Core\Cache\Backend\NullBackend::class,
'frontend' => \TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class,
];
}
return $cacheConfiguration;
}
} }