mirror of
https://github.com/friendica/friendica
synced 2025-04-28 20:24:24 +02:00
Refactor Cache/Lock to DICE
- Refactor Cache classes - Refactor Lock classes - Improved test speed (removed some seperate class annotations)
This commit is contained in:
parent
b95d4f41b9
commit
d56bd28a07
40 changed files with 766 additions and 621 deletions
|
@ -3,8 +3,9 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache\RedisCacheDriver;
|
||||
use Friendica\Core\Config\Configuration;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Factory\CacheDriverFactory;
|
||||
|
||||
/**
|
||||
* @requires extension redis
|
||||
|
@ -13,26 +14,26 @@ class RedisCacheLockDriverTest extends LockTest
|
|||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
$this->configMock
|
||||
$configMock = \Mockery::mock(Configuration::class);
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_host')
|
||||
->andReturn('localhost');
|
||||
|
||||
$this->configMock
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_port')
|
||||
->andReturn(null);
|
||||
|
||||
$this->configMock
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_db')
|
||||
->with('system', 'redis_db', 0)
|
||||
->andReturn(3);
|
||||
|
||||
$this->configMock
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_password')
|
||||
->andReturn(null);
|
||||
|
||||
return new CacheLockDriver(CacheDriverFactory::create('redis'));
|
||||
return new CacheLockDriver(new RedisCacheDriver('localhost', $configMock));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue