2 declare(strict_types = 1);
20 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
37 protected function setUp(): void
40 $this->directoryName = uniqid(
'test');
47 GeneralUtility::rmdir($this->directoryPath,
true);
48 unset($this->directoryName, $this->directoryPath);
56 $this->expectException(\RuntimeException::class);
57 $this->expectExceptionCode(1501781454);
58 $subject =
new Typo3tempFileService();
59 $subject->clearAssetsFolder(
'/typo3temp/assets/' . $this->directoryName);
67 GeneralUtility::mkdir_deep($this->directoryPath .
'/a/b');
68 file_put_contents($this->directoryPath .
'/c.css',
'/* test */');
69 file_put_contents($this->directoryPath .
'/a/b/c.css',
'/* test */');
70 file_put_contents($this->directoryPath .
'/a/b/d.css',
'/* test */');
72 $subject =
new Typo3tempFileService();
73 $subject->clearAssetsFolder(
'/typo3temp/assets/' . $this->directoryName);
75 self::assertDirectoryNotExists($this->directoryPath .
'/a');
76 self::assertDirectoryExists($this->directoryPath);
77 self::assertFileNotExists($this->directoryPath .
'/c.css');