2018-07-04 23:37:22 +02:00
|
|
|
<?php
|
|
|
|
|
2018-07-05 20:57:31 +02:00
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
2018-07-04 23:37:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
use Friendica\Core\Cache\ArrayCache;
|
|
|
|
use Friendica\Core\Lock\CacheLockDriver;
|
|
|
|
|
2018-07-07 16:15:03 +02:00
|
|
|
class ArrayCacheLockDriverTest extends LockTest
|
2018-07-04 23:37:22 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \Friendica\Core\Cache\IMemoryCacheDriver
|
|
|
|
*/
|
|
|
|
private $cache;
|
|
|
|
|
|
|
|
protected function getInstance()
|
|
|
|
{
|
|
|
|
$this->cache = new ArrayCache();
|
|
|
|
return new CacheLockDriver($this->cache);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
$this->cache->clear();
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
2018-07-07 19:46:16 +02:00
|
|
|
|
|
|
|
public function testLockTTL()
|
|
|
|
{
|
|
|
|
// ArrayCache doesn't support TTL
|
|
|
|
return true;
|
|
|
|
}
|
2018-07-07 16:15:03 +02:00
|
|
|
}
|