Skip to content

Commit

Permalink
[BUGFIX] Clear fluid cache after example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s2b authored and sbuerk committed Oct 16, 2023
1 parent 90afa20 commit a7627ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/src/Helper/ExampleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,13 @@ public function output(string $content): void
echo '#' . PHP_EOL;
echo trim($content) . PHP_EOL . PHP_EOL;
}

public function cleanup(): void
{
$cachePath = sys_get_temp_dir() . '/' . 'fluid-examples';
if (!is_dir($cachePath)) {
return;
}
(new SimpleFileCache($cachePath))->flush();
}
}
8 changes: 8 additions & 0 deletions tests/Functional/ExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace TYPO3Fluid\Fluid\Tests\Functional;

use TYPO3Fluid\FluidExamples\Helper\ExampleHelper;

final class ExamplesTest extends AbstractFunctionalTestCase
{
public static function exampleScriptValuesDataProvider(): array
Expand Down Expand Up @@ -232,4 +234,10 @@ public function exampleScriptValues(string $script, array $expectedOutputs): voi
ob_end_clean();
call_user_func($outputCallback, $output);
}

public static function tearDownAfterClass(): void
{
(new ExampleHelper())->cleanup();
parent::tearDownAfterClass();
}
}

0 comments on commit a7627ec

Please sign in to comment.