‪TYPO3CMS  9.5
FileLockStrategyTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
25 class ‪FileLockStrategyTest extends UnitTestCase
26 {
31  {
32  GeneralUtility::rmdir(‪Environment::getVarPath() . '/' . ‪FileLockStrategy::FILE_LOCK_FOLDER, true);
33  new ‪FileLockStrategy('999999999');
34  $this->assertTrue(is_dir(‪Environment::getVarPath() . '/' . ‪FileLockStrategy::FILE_LOCK_FOLDER));
35  }
36 
41  {
42  $lock = $this->getAccessibleMock(FileLockStrategy::class, ['dummy'], ['999999999']);
43  $this->assertSame(‪Environment::getVarPath() . '/' . ‪FileLockStrategy::FILE_LOCK_FOLDER . 'flock_' . md5('999999999'), $lock->_get('filePath'));
44  }
45 }
‪TYPO3\CMS\Core\Tests\Unit\Locking\FileLockStrategyTest\constructorCreatesLockDirectoryIfNotExisting
‪constructorCreatesLockDirectoryIfNotExisting()
Definition: FileLockStrategyTest.php:30
‪TYPO3\CMS\Core\Tests\Unit\Locking\FileLockStrategyTest
Definition: FileLockStrategyTest.php:26
‪TYPO3\CMS\Core\Tests\Unit\Locking
Definition: FileLockStrategyTest.php:2
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Locking\FileLockStrategy\FILE_LOCK_FOLDER
‪const FILE_LOCK_FOLDER
Definition: FileLockStrategy.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Locking\FileLockStrategy
Definition: FileLockStrategy.php:28
‪TYPO3\CMS\Core\Tests\Unit\Locking\FileLockStrategyTest\constructorSetsFilePathToExpectedValue
‪constructorSetsFilePathToExpectedValue()
Definition: FileLockStrategyTest.php:40
‪TYPO3\CMS\Core\Core\Environment\getVarPath
‪static string getVarPath()
Definition: Environment.php:165