Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lock] rename and deprecate Factory into LockFactory
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Lock; | ||
|
||
/** | ||
* Factory provides method to create locks. | ||
* | ||
* @author Jérémy Derussé <jeremy@derusse.com> | ||
* @author Hamza Amrouche <hamza.simperfit@gmail.com> | ||
*/ | ||
class LockFactory extends Factory | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Lock\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Psr\Log\LoggerInterface; | ||
use Symfony\Component\Lock\LockFactory; | ||
use Symfony\Component\Lock\LockInterface; | ||
use Symfony\Component\Lock\StoreInterface; | ||
|
||
/** | ||
* @author Jérémy Derussé <jeremy@derusse.com> | ||
*/ | ||
class LockFactoryTest extends TestCase | ||
{ | ||
public function testCreateLock() | ||
{ | ||
$store = $this->getMockBuilder(StoreInterface::class)->getMock(); | ||
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); | ||
$factory = new LockFactory($store); | ||
$factory->setLogger($logger); | ||
|
||
$lock = $factory->createLock('foo'); | ||
|
||
$this->assertInstanceOf(LockInterface::class, $lock); | ||
} | ||
} |