2018-07-07 16:15:03 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
|
|
|
|
2019-03-03 15:34:07 +01:00
|
|
|
use Friendica\Factory\CacheDriverFactory;
|
2018-07-07 16:15:03 +02:00
|
|
|
use Friendica\Core\Lock\CacheLockDriver;
|
|
|
|
|
2018-07-18 21:04:18 +02:00
|
|
|
/**
|
|
|
|
* @requires extension redis
|
|
|
|
*/
|
2018-07-07 16:15:03 +02:00
|
|
|
class RedisCacheLockDriverTest extends LockTest
|
|
|
|
{
|
|
|
|
protected function getInstance()
|
|
|
|
{
|
2019-02-17 21:41:45 +01:00
|
|
|
$this->configMock
|
2019-02-07 20:44:03 +01:00
|
|
|
->shouldReceive('get')
|
2019-02-17 21:41:45 +01:00
|
|
|
->with('system', 'redis_host')
|
2019-02-07 20:44:03 +01:00
|
|
|
->andReturn('localhost');
|
|
|
|
|
2019-02-17 21:41:45 +01:00
|
|
|
$this->configMock
|
2019-02-07 20:44:03 +01:00
|
|
|
->shouldReceive('get')
|
2019-02-17 21:41:45 +01:00
|
|
|
->with('system', 'redis_port')
|
2019-02-07 20:44:03 +01:00
|
|
|
->andReturn(null);
|
2018-07-18 21:04:18 +02:00
|
|
|
|
2019-01-30 20:26:17 +01:00
|
|
|
return new CacheLockDriver(CacheDriverFactory::create('redis'));
|
2018-07-07 16:15:03 +02:00
|
|
|
}
|
|
|
|
}
|