[Lock] remove uusage of the StoreInterface
This commit is contained in:
parent
52e9fb91ff
commit
9988844eb4
@ -1600,7 +1600,7 @@ class FrameworkExtension extends Extension
|
|||||||
$container->setDefinition($connectionDefinitionId, $connectionDefinition);
|
$container->setDefinition($connectionDefinitionId, $connectionDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
$storeDefinition = new Definition(StoreInterface::class);
|
$storeDefinition = new Definition(PersistStoreInterface::class);
|
||||||
$storeDefinition->setPublic(false);
|
$storeDefinition->setPublic(false);
|
||||||
$storeDefinition->setFactory([StoreFactory::class, 'createStore']);
|
$storeDefinition->setFactory([StoreFactory::class, 'createStore']);
|
||||||
$storeDefinition->setArguments([new Reference($connectionDefinitionId)]);
|
$storeDefinition->setArguments([new Reference($connectionDefinitionId)]);
|
||||||
|
@ -18,7 +18,6 @@ use Symfony\Component\Lock\Exception\LockConflictedException;
|
|||||||
use Symfony\Component\Lock\Key;
|
use Symfony\Component\Lock\Key;
|
||||||
use Symfony\Component\Lock\Lock;
|
use Symfony\Component\Lock\Lock;
|
||||||
use Symfony\Component\Lock\PersistStoreInterface;
|
use Symfony\Component\Lock\PersistStoreInterface;
|
||||||
use Symfony\Component\Lock\StoreInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jérémy Derussé <jeremy@derusse.com>
|
* @author Jérémy Derussé <jeremy@derusse.com>
|
||||||
@ -41,7 +40,7 @@ class LockTest extends TestCase
|
|||||||
public function testAcquireNoBlockingStoreInterface()
|
public function testAcquireNoBlockingStoreInterface()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store);
|
$lock = new Lock($key, $store);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -59,7 +58,7 @@ class LockTest extends TestCase
|
|||||||
public function testPassingOldStoreInterface()
|
public function testPassingOldStoreInterface()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store);
|
$lock = new Lock($key, $store);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -86,7 +85,7 @@ class LockTest extends TestCase
|
|||||||
public function testAcquireReturnsFalseStoreInterface()
|
public function testAcquireReturnsFalseStoreInterface()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store);
|
$lock = new Lock($key, $store);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -121,7 +120,7 @@ class LockTest extends TestCase
|
|||||||
public function testAcquireSetsTtl()
|
public function testAcquireSetsTtl()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store, 10);
|
$lock = new Lock($key, $store, 10);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -138,7 +137,7 @@ class LockTest extends TestCase
|
|||||||
public function testRefresh()
|
public function testRefresh()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store, 10);
|
$lock = new Lock($key, $store, 10);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -152,7 +151,7 @@ class LockTest extends TestCase
|
|||||||
public function testRefreshCustom()
|
public function testRefreshCustom()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store, 10);
|
$lock = new Lock($key, $store, 10);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -201,7 +200,7 @@ class LockTest extends TestCase
|
|||||||
public function testReleaseStoreInterface()
|
public function testReleaseStoreInterface()
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store, 10);
|
$lock = new Lock($key, $store, 10);
|
||||||
|
|
||||||
$store
|
$store
|
||||||
@ -356,7 +355,7 @@ class LockTest extends TestCase
|
|||||||
public function testExpirationStoreInterface($ttls, $expected)
|
public function testExpirationStoreInterface($ttls, $expected)
|
||||||
{
|
{
|
||||||
$key = new Key(uniqid(__METHOD__, true));
|
$key = new Key(uniqid(__METHOD__, true));
|
||||||
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$lock = new Lock($key, $store, 10);
|
$lock = new Lock($key, $store, 10);
|
||||||
|
|
||||||
foreach ($ttls as $ttl) {
|
foreach ($ttls as $ttl) {
|
||||||
|
@ -14,7 +14,7 @@ namespace Symfony\Component\Lock\Tests\Store;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Symfony\Component\Lock\Exception\LockConflictedException;
|
use Symfony\Component\Lock\Exception\LockConflictedException;
|
||||||
use Symfony\Component\Lock\Key;
|
use Symfony\Component\Lock\Key;
|
||||||
use Symfony\Component\Lock\StoreInterface;
|
use Symfony\Component\Lock\PersistStoreInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jérémy Derussé <jeremy@derusse.com>
|
* @author Jérémy Derussé <jeremy@derusse.com>
|
||||||
@ -22,7 +22,7 @@ use Symfony\Component\Lock\StoreInterface;
|
|||||||
abstract class AbstractStoreTest extends TestCase
|
abstract class AbstractStoreTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return StoreInterface
|
* @return PersistStoreInterface
|
||||||
*/
|
*/
|
||||||
abstract protected function getStore();
|
abstract protected function getStore();
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace Symfony\Component\Lock\Tests\Store;
|
|||||||
use Symfony\Component\Lock\Exception\LockConflictedException;
|
use Symfony\Component\Lock\Exception\LockConflictedException;
|
||||||
use Symfony\Component\Lock\Exception\NotSupportedException;
|
use Symfony\Component\Lock\Exception\NotSupportedException;
|
||||||
use Symfony\Component\Lock\Key;
|
use Symfony\Component\Lock\Key;
|
||||||
use Symfony\Component\Lock\StoreInterface;
|
use Symfony\Component\Lock\PersistStoreInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jérémy Derussé <jeremy@derusse.com>
|
* @author Jérémy Derussé <jeremy@derusse.com>
|
||||||
@ -24,7 +24,7 @@ trait BlockingStoreTestTrait
|
|||||||
/**
|
/**
|
||||||
* @see AbstractStoreTest::getStore()
|
* @see AbstractStoreTest::getStore()
|
||||||
*
|
*
|
||||||
* @return StoreInterface
|
* @return PersistStoreInterface
|
||||||
*/
|
*/
|
||||||
abstract protected function getStore();
|
abstract protected function getStore();
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ use Symfony\Component\Lock\Key;
|
|||||||
use Symfony\Component\Lock\PersistStoreInterface;
|
use Symfony\Component\Lock\PersistStoreInterface;
|
||||||
use Symfony\Component\Lock\Store\CombinedStore;
|
use Symfony\Component\Lock\Store\CombinedStore;
|
||||||
use Symfony\Component\Lock\Store\RedisStore;
|
use Symfony\Component\Lock\Store\RedisStore;
|
||||||
use Symfony\Component\Lock\StoreInterface;
|
|
||||||
use Symfony\Component\Lock\Strategy\StrategyInterface;
|
use Symfony\Component\Lock\Strategy\StrategyInterface;
|
||||||
use Symfony\Component\Lock\Strategy\UnanimousStrategy;
|
use Symfony\Component\Lock\Strategy\UnanimousStrategy;
|
||||||
|
|
||||||
@ -268,8 +267,8 @@ class CombinedStoreTest extends AbstractStoreTest
|
|||||||
|
|
||||||
public function testPutOffExpirationIgnoreNonExpiringStorage()
|
public function testPutOffExpirationIgnoreNonExpiringStorage()
|
||||||
{
|
{
|
||||||
$store1 = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store1 = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
$store2 = $this->getMockBuilder(StoreInterface::class)->getMock();
|
$store2 = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
|
||||||
|
|
||||||
$store = new CombinedStore([$store1, $store2], $this->strategy);
|
$store = new CombinedStore([$store1, $store2], $this->strategy);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user