Commit 7ba1c2b4 authored by Daniel Hürtgen's avatar Daniel Hürtgen

[TASK] Renamed MutexAdapterStrategy

parent d8e775aa
......@@ -4,7 +4,7 @@ namespace Higidi\Lock\Configuration;
use Higidi\Lock\Configuration\Exception\InvalidMutexException;
use Higidi\Lock\Configuration\Exception\InvalidStrategyException;
use Higidi\Lock\Strategy\NinjaMutexAdapterStrategy;
use Higidi\Lock\Strategy\MutexAdapterStrategy;
use NinjaMutex\Mutex;
use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
use TYPO3\CMS\Core\Locking\SimpleLockStrategy;
......@@ -113,7 +113,7 @@ class Configuration implements SingletonInterface
*/
public function isMutexStrategy()
{
return $this->isActive() && is_a($this->getStrategy(), NinjaMutexAdapterStrategy::class, true);
return $this->isActive() && is_a($this->getStrategy(), MutexAdapterStrategy::class, true);
}
/**
......
......@@ -12,7 +12,7 @@ use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
/**
* TYPO3 lock strategy adapter for the arvenil/ninja-mutex library.
*/
class NinjaMutexAdapterStrategy implements LockingStrategyInterface
class MutexAdapterStrategy implements LockingStrategyInterface
{
/**
* @var Mutex
......
......@@ -3,7 +3,7 @@
namespace Higidi\Lock\Tests\Unit\Configuration;
use Higidi\Lock\Configuration\Configuration;
use Higidi\Lock\Strategy\NinjaMutexAdapterStrategy;
use Higidi\Lock\Strategy\MutexAdapterStrategy;
use Nimut\TestingFramework\TestCase\UnitTestCase;
use NinjaMutex\Mutex;
use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
......@@ -223,7 +223,7 @@ class ConfigurationTest extends UnitTestCase
*/
public function itDetectsTheMutexAdapterStrategy()
{
$strategy = $this->prophesize(NinjaMutexAdapterStrategy::class)->reveal();
$strategy = $this->prophesize(MutexAdapterStrategy::class)->reveal();
$className = get_class($strategy);
$sut = new Configuration();
......
......@@ -2,17 +2,17 @@
namespace Higidi\Lock\Tests\Unit\Strategy;
use Higidi\Lock\Strategy\NinjaMutexAdapterStrategy;
use Higidi\Lock\Strategy\MutexAdapterStrategy;
use Nimut\TestingFramework\TestCase\UnitTestCase;
use NinjaMutex\Mutex;
use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
/**
* Test case for "\Higidi\Lock\Strategy\NinjaMutexAdapterStrategy".
* Test case for "\Higidi\Lock\Strategy\MutexAdapterStrategy".
*
* @covers \Higidi\Lock\Strategy\NinjaMutexAdapterStrategy
* @covers \Higidi\Lock\Strategy\MutexAdapterStrategy
*/
class NinjaMutexAdapterStrategyTest extends UnitTestCase
class MutexAdapterStrategyTest extends UnitTestCase
{
/**
* @test
......@@ -20,7 +20,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
public function itImplementsTheLockStrategyInterface()
{
$mutex = $this->prophesize(Mutex::class);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$this->assertInstanceOf(LockingStrategyInterface::class, $sut);
}
......@@ -32,7 +32,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
*/
public function itThrowsAnInvalidArgumentExceptionIfMutexIsNotPassed()
{
new NinjaMutexAdapterStrategy('blafoo');
new MutexAdapterStrategy('blafoo');
}
/**
......@@ -40,7 +40,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
*/
public function itReturnsAnExclusiveCapability()
{
$capabilities = NinjaMutexAdapterStrategy::getCapabilities();
$capabilities = MutexAdapterStrategy::getCapabilities();
$capability = LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE;
$this->assertSame($capability, $capabilities & $capability);
......@@ -51,7 +51,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
*/
public function itReturnsANoBlockCapability()
{
$capabilities = NinjaMutexAdapterStrategy::getCapabilities();
$capabilities = MutexAdapterStrategy::getCapabilities();
$capability = LockingStrategyInterface::LOCK_CAPABILITY_NOBLOCK;
$this->assertSame($capability, $capabilities & $capability);
......@@ -62,7 +62,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
*/
public function itReturnsAPriority()
{
$priority = NinjaMutexAdapterStrategy::getPriority();
$priority = MutexAdapterStrategy::getPriority();
$this->assertSame(0, $priority);
}
......@@ -77,7 +77,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
->acquireLock(null)
->shouldBeCalled()
->willReturn(true);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$this->assertTrue($sut->acquire());
}
......@@ -93,7 +93,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
->acquireLock(0)
->shouldBeCalled()
->willReturn(true);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$this->assertTrue($sut->acquire($mode));
}
......@@ -108,7 +108,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
->releaseLock()
->shouldBeCalled()
->willReturn(true);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$this->assertTrue($sut->release());
}
......@@ -123,7 +123,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
->releaseLock()
->shouldBeCalled()
->willReturn(true);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$sut->destroy();
}
......@@ -138,7 +138,7 @@ class NinjaMutexAdapterStrategyTest extends UnitTestCase
->isAcquired()
->shouldBeCalled()
->willReturn(true);
$sut = new NinjaMutexAdapterStrategy($mutex->reveal());
$sut = new MutexAdapterStrategy($mutex->reveal());
$this->assertTrue($sut->isAcquired());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment