Skip to content

Commit d6ac4b5

Browse files
committed
[FEATURE] Add 13LTS support for CacheNullifyer
1 parent e1c7a94 commit d6ac4b5

File tree

2 files changed

+165
-2
lines changed

2 files changed

+165
-2
lines changed

Classes/Testing/CacheNullifyer.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,96 @@ final class CacheNullifyer
179179
'options' => [],
180180
],
181181
],
182+
13 => [
183+
'assets' => [
184+
'backend' => SimpleFileBackend::class,
185+
'frontend' => VariableFrontend::class,
186+
'groups' => ['system'],
187+
'options' => [],
188+
],
189+
'core' => [
190+
'backend' => SimpleFileBackend::class,
191+
'frontend' => PhpFrontend::class,
192+
'groups' => ['system'],
193+
'options' => [],
194+
],
195+
'database_schema' => [
196+
'backend' => SimpleFileBackend::class,
197+
'frontend' => VariableFrontend::class,
198+
'groups' => ['system'],
199+
'options' => [],
200+
],
201+
'extbase' => [
202+
'backend' => SimpleFileBackend::class,
203+
'frontend' => VariableFrontend::class,
204+
'groups' => ['system'],
205+
'options' => [
206+
'defaultLifetime' => 0,
207+
],
208+
],
209+
'fluid_template' => [
210+
'backend' => SimpleFileBackend::class,
211+
'frontend' => FluidTemplateCache::class,
212+
'groups' => ['system'],
213+
'options' => [],
214+
],
215+
'hash' => [
216+
'backend' => NullBackend::class,
217+
'frontend' => VariableFrontend::class,
218+
'groups' => ['pages'],
219+
'options' => [],
220+
],
221+
'imagesizes' => [
222+
'backend' => NullBackend::class,
223+
'frontend' => VariableFrontend::class,
224+
'options' => [
225+
'compression' => true,
226+
],
227+
],
228+
'l10n' => [
229+
'backend' => SimpleFileBackend::class,
230+
'frontend' => VariableFrontend::class,
231+
'groups' => ['system'],
232+
'options' => [
233+
'defaultLifetime' => 0,
234+
],
235+
],
236+
'pages' => [
237+
'backend' => NullBackend::class,
238+
'frontend' => VariableFrontend::class,
239+
'groups' => ['pages'],
240+
'options' => [
241+
'compression' => true,
242+
],
243+
],
244+
'ratelimiter' => [
245+
'backend' => SimpleFileBackend::class,
246+
'frontend' => VariableFrontend::class,
247+
'groups' => ['system'],
248+
'options' => [],
249+
],
250+
'rootline' => [
251+
'backend' => NullBackend::class,
252+
'frontend' => VariableFrontend::class,
253+
'groups' => ['pages'],
254+
'options' => [
255+
'compression' => true,
256+
'defaultLifetime' => 0,
257+
],
258+
],
259+
'runtime' => [
260+
'backend' => TransientMemoryBackend::class,
261+
'frontend' => VariableFrontend::class,
262+
'groups' => [],
263+
'options' => [],
264+
],
265+
'typoscript' => [
266+
'backend' => SimpleFileBackend::class,
267+
'frontend' => NullFrontend::class,
268+
'groups' => ['pages'],
269+
'options' => [],
270+
],
271+
],
182272
];
183273

184274
/**

Tests/Functional/Testing/CacheNullifyerTest.php

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function setUp(): void
3131
}
3232

3333
/**
34-
* @return array<string, array{0: non-empty-string}>
34+
* @return array<non-empty-string, array{0: non-empty-string}>
3535
*/
3636
public function coreCachesVersion11DataProvider(): array
3737
{
@@ -103,7 +103,7 @@ public function setAllCoreCachesSetsACacheBackendForAllCachesForVersion11(string
103103
}
104104

105105
/**
106-
* @return array<string, array{0: non-empty-string}>
106+
* @return array<non-empty-string, array{0: non-empty-string}>
107107
*/
108108
public function coreCachesVersion12DataProvider(): array
109109
{
@@ -174,4 +174,77 @@ public function setAllCoreCachesSetsACacheBackendForAllCachesForVersion12(string
174174
self::assertInstanceOf(FrontendInterface::class, $cache);
175175
self::assertInstanceOf(BackendInterface::class, $cache->getBackend());
176176
}
177+
178+
/**
179+
* @return array<non-empty-string, array{0: non-empty-string}>
180+
*/
181+
public function coreCachesVersion13DataProvider(): array
182+
{
183+
return [
184+
'assets' => ['assets'],
185+
'core' => ['extbase'],
186+
'database_schema' => ['extbase'],
187+
'extbase' => ['extbase'],
188+
'fluid_template' => ['fluid_template'],
189+
'hash' => ['hash'],
190+
'imagesizes' => ['imagesizes'],
191+
'l10n' => ['l10n'],
192+
'pages' => ['pages'],
193+
'rootline' => ['rootline'],
194+
'ratelimiter' => ['runtime'],
195+
'runtime' => ['runtime'],
196+
'typoscript' => ['runtime'],
197+
];
198+
}
199+
200+
/**
201+
* @test
202+
*
203+
* @dataProvider coreCachesVersion13DataProvider
204+
*/
205+
public function setAllCoreCachesSetsAllCachesForVersion13(string $identifier): void
206+
{
207+
if ((new Typo3Version())->getMajorVersion() !== 13) {
208+
self::markTestSkipped('This test is only for TYPO3 v13.');
209+
}
210+
211+
$this->subject->setAllCoreCaches();
212+
213+
self::assertTrue(GeneralUtility::makeInstance(CacheManager::class)->hasCache($identifier));
214+
}
215+
216+
/**
217+
* @test
218+
*
219+
* @dataProvider coreCachesVersion13DataProvider
220+
*/
221+
public function setAllCoreCachesSetsACacheFrontendForAllCachesForVersion13(string $identifier): void
222+
{
223+
if ((new Typo3Version())->getMajorVersion() !== 13) {
224+
self::markTestSkipped('This test is only for TYPO3 v13.');
225+
}
226+
227+
$this->subject->setAllCoreCaches();
228+
229+
$cache = GeneralUtility::makeInstance(CacheManager::class)->getCache($identifier);
230+
self::assertInstanceOf(FrontendInterface::class, $cache);
231+
}
232+
233+
/**
234+
* @test
235+
*
236+
* @dataProvider coreCachesVersion13DataProvider
237+
*/
238+
public function setAllCoreCachesSetsACacheBackendForAllCachesForVersion13(string $identifier): void
239+
{
240+
if ((new Typo3Version())->getMajorVersion() !== 13) {
241+
self::markTestSkipped('This test is only for TYPO3 v13.');
242+
}
243+
244+
$this->subject->setAllCoreCaches();
245+
246+
$cache = GeneralUtility::makeInstance(CacheManager::class)->getCache($identifier);
247+
self::assertInstanceOf(FrontendInterface::class, $cache);
248+
self::assertInstanceOf(BackendInterface::class, $cache->getBackend());
249+
}
177250
}

0 commit comments

Comments
 (0)