mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-21 19:56:12 +01:00
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:
parent
97c0485e6f
commit
4234575c36
1 changed files with 22 additions and 6 deletions
|
@ -39,14 +39,9 @@ abstract class AbstractUnitTestCase extends CoreTestCase
|
|||
$this->singletonInstances = GeneralUtility::getSingletonInstances();
|
||||
|
||||
// Disable caching backends to make TYPO3 parts work in unit test mode.
|
||||
|
||||
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
|
||||
\TYPO3\CMS\Core\Cache\CacheManager::class
|
||||
)->setCacheConfigurations([
|
||||
'extbase_object' => [
|
||||
'backend' => \TYPO3\CMS\Core\Cache\Backend\NullBackend::class,
|
||||
],
|
||||
]);
|
||||
)->setCacheConfigurations($this->getCacheConfiguration());
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
|
@ -100,4 +95,25 @@ abstract class AbstractUnitTestCase extends CoreTestCase
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue