‪TYPO3CMS  11.5
Typo3tempFileServiceTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Prophecy\PhpUnit\ProphecyTrait;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
25 
29 class ‪Typo3tempFileServiceTest extends UnitTestCase
30 {
31  use ProphecyTrait;
32 
36  public function ‪clearAssetsFolderThrowsWithInvalidPath(): void
37  {
38  $this->expectException(\RuntimeException::class);
39  $this->expectExceptionCode(1501781453);
40  $processedFileRepository = $this->prophesize(ProcessedFileRepository::class);
41  $storageRepository = $this->prophesize(StorageRepository::class);
42  $subject = new ‪Typo3tempFileService($processedFileRepository->reveal(), $storageRepository->reveal());
43  $subject->clearAssetsFolder('../foo');
44  }
45 
50  {
51  $this->expectException(\RuntimeException::class);
52  $this->expectExceptionCode(1501781453);
53  $processedFileRepository = $this->prophesize(ProcessedFileRepository::class);
54  $storageRepository = $this->prophesize(StorageRepository::class);
55  $subject = new ‪Typo3tempFileService($processedFileRepository->reveal(), $storageRepository->reveal());
56  $subject->clearAssetsFolder('typo3temp/foo');
57  }
58 }
‪TYPO3\CMS\Core\Resource\ProcessedFileRepository
Definition: ProcessedFileRepository.php:31
‪TYPO3\CMS\Install\Service\Typo3tempFileService
Definition: Typo3tempFileService.php:32
‪TYPO3\CMS\Install\Tests\Unit\Service\Typo3tempFileServiceTest\clearAssetsFolderThrowsIfPathDoesNotStartWithTypotempAssets
‪clearAssetsFolderThrowsIfPathDoesNotStartWithTypotempAssets()
Definition: Typo3tempFileServiceTest.php:48
‪TYPO3\CMS\Install\Tests\Unit\Service\Typo3tempFileServiceTest\clearAssetsFolderThrowsWithInvalidPath
‪clearAssetsFolderThrowsWithInvalidPath()
Definition: Typo3tempFileServiceTest.php:35
‪TYPO3\CMS\Core\Resource\StorageRepository
Definition: StorageRepository.php:38
‪TYPO3\CMS\Install\Tests\Unit\Service\Typo3tempFileServiceTest
Definition: Typo3tempFileServiceTest.php:30
‪TYPO3\CMS\Install\Tests\Unit\Service
Definition: ClearTableServiceTest.php:18