‪TYPO3CMS  ‪main
AbstractFolderStructureTestCase.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 
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
25 abstract class ‪AbstractFolderStructureTestCase extends UnitTestCase
26 {
33  protected function ‪getTestDirectory($prefix = 'root_'): string
34  {
35  $testRoot = ‪Environment::getVarPath() . '/tests/';
36  $this->testFilesToDelete[] = $testRoot;
37  $path = $testRoot . ‪StringUtility::getUniqueId($prefix);
39  chmod($testRoot, 02777);
40  return $path;
41  }
42 
48  protected function ‪getTestFilePath($prefix = 'file_'): string
49  {
50  return $this->‪getTestDirectory() . '/' . ‪StringUtility::getUniqueId($prefix);
51  }
52 }
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase\getTestDirectory
‪getTestDirectory($prefix='root_')
Definition: AbstractFolderStructureTestCase.php:33
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase\getTestFilePath
‪non empty string getTestFilePath($prefix='file_')
Definition: AbstractFolderStructureTestCase.php:48
‪TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep
‪static mkdir_deep(string $directory)
Definition: GeneralUtility.php:1654
‪TYPO3\CMS\Core\Core\Environment\getVarPath
‪static getVarPath()
Definition: Environment.php:197
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase
Definition: AbstractFolderStructureTestCase.php:26
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure
Definition: AbstractFolderStructureTestCase.php:18
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:24
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static getUniqueId(string $prefix='')
Definition: StringUtility.php:57