‪TYPO3CMS  10.4
SemaphoreLockStrategyTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
27 class ‪SemaphoreLockStrategyTest extends UnitTestCase
28 {
32  public function ‪acquireGetsSemaphore()
33  {
34  $lock = new ‪SemaphoreLockStrategy('99999');
35  self::assertTrue($lock->acquire());
36  $lock->release();
37  $lock->destroy();
38  }
39 
44  {
46  }
47 
51  public function ‪setPriority()
52  {
53  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['strategies'][SemaphoreLockStrategy::class]['priority'] = 10;
54 
55  self::assertEquals(10, ‪SemaphoreLockStrategy::getPriority());
56  unset(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['strategies'][SemaphoreLockStrategy::class]['priority']);
57  }
58 }
‪TYPO3\CMS\Core\Locking\SemaphoreLockStrategy\getPriority
‪static int getPriority()
Definition: SemaphoreLockStrategy.php:160
‪TYPO3\CMS\Core\Tests\Unit\Locking\SemaphoreLockStrategyTest\getPriorityReturnsDefaultPriority
‪getPriorityReturnsDefaultPriority()
Definition: SemaphoreLockStrategyTest.php:43
‪TYPO3\CMS\Core\Tests\Unit\Locking\SemaphoreLockStrategyTest\acquireGetsSemaphore
‪acquireGetsSemaphore()
Definition: SemaphoreLockStrategyTest.php:32
‪TYPO3\CMS\Core\Locking\SimpleLockStrategy\getPriority
‪static int getPriority()
Definition: SimpleLockStrategy.php:191
‪TYPO3\CMS\Core\Locking\SemaphoreLockStrategy
Definition: SemaphoreLockStrategy.php:28
‪TYPO3\CMS\Core\Tests\Unit\Locking\SemaphoreLockStrategyTest\setPriority
‪setPriority()
Definition: SemaphoreLockStrategyTest.php:51
‪TYPO3\CMS\Core\Tests\Unit\Locking\SemaphoreLockStrategyTest
Definition: SemaphoreLockStrategyTest.php:28
‪TYPO3\CMS\Core\Tests\Unit\Locking
Definition: FileLockStrategyTest.php:16
‪TYPO3\CMS\Core\Locking\SimpleLockStrategy
Definition: SimpleLockStrategy.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Locking\SimpleLockStrategy\DEFAULT_PRIORITY
‪const DEFAULT_PRIORITY
Definition: SimpleLockStrategy.php:32