Skip to content
Snippets Groups Projects
Commit bb8fe3e1 authored by Daniel Hürtgen's avatar Daniel Hürtgen
Browse files

[TASK] Remove injected LockBuilder from LockFactory

parent b0a7dbb8
Branches
Tags
No related merge requests found
......@@ -19,25 +19,15 @@ class LockFactory extends CoreLockFactory
*/
protected $configuration;
/**
* @var LockBuilder
*/
protected $lockBuilder;
/**
* @param Configuration|null $configuration The configuration to use
* @param LockBuilder|null $lockBuilder The lock implementation builder to use
*/
public function __construct(Configuration $configuration = null, LockBuilder $lockBuilder = null)
{
if (null === $configuration) {
$configuration = GeneralUtility::makeInstance(Configuration::class);
}
if (null === $lockBuilder) {
$lockBuilder = GeneralUtility::makeInstance(LockBuilder::class);
}
$this->configuration = $configuration;
$this->lockBuilder = $lockBuilder;
}
/**
......@@ -50,16 +40,6 @@ class LockFactory extends CoreLockFactory
return $this->configuration;
}
/**
* Get lock builder.
*
* @return LockBuilder
*/
public function getLockBuilder()
{
return $this->lockBuilder;
}
/**
* Get best matching locking method
*
......
......@@ -61,28 +61,6 @@ class LockFactoryTest extends UnitTestCase
$this->assertSame($configuration->reveal(), $sut->getConfiguration());
}
/**
* @test
*/
public function itCreatesADefaultLockBuilderIfNotPassed()
{
$sut = new LockFactory();
$this->assertInstanceOf(LockBuilder::class, $sut->getLockBuilder());
}
/**
* @test
*/
public function itHoldsALockBuilder()
{
$lockBuilder = $this->prophesize(LockBuilder::class);
$sut = new LockFactory(null, $lockBuilder->reveal());
$this->assertSame($lockBuilder->reveal(), $sut->getLockBuilder());
}
/**
* @test
*/
......
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