mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 23:34:27 +02:00
- Refactor Cache classes - Refactor Lock classes - Improved test speed (removed some seperate class annotations)
39 lines
832 B
PHP
39 lines
832 B
PHP
<?php
|
|
|
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
|
|
|
use Friendica\Core\Cache\RedisCacheDriver;
|
|
use Friendica\Core\Config\Configuration;
|
|
use Friendica\Core\Lock\CacheLockDriver;
|
|
|
|
/**
|
|
* @requires extension redis
|
|
*/
|
|
class RedisCacheLockDriverTest extends LockTest
|
|
{
|
|
protected function getInstance()
|
|
{
|
|
$configMock = \Mockery::mock(Configuration::class);
|
|
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'redis_host')
|
|
->andReturn('localhost');
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'redis_port')
|
|
->andReturn(null);
|
|
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'redis_db', 0)
|
|
->andReturn(3);
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'redis_password')
|
|
->andReturn(null);
|
|
|
|
return new CacheLockDriver(new RedisCacheDriver('localhost', $configMock));
|
|
}
|
|
}
|