Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TYPO3
Extensions
lock
Commits
bb8fe3e1
Commit
bb8fe3e1
authored
Nov 11, 2017
by
Daniel Hürtgen
Browse files
[TASK] Remove injected LockBuilder from LockFactory
parent
b0a7dbb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Classes/LockFactory.php
View file @
bb8fe3e1
...
...
@@ -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
*
...
...
Tests/Unit/LockFactoryTest.php
View file @
bb8fe3e1
...
...
@@ -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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment