Refactor Cache/Lock to DICE

- Refactor Cache classes
- Refactor Lock classes
- Improved test speed (removed some seperate class annotations)
This commit is contained in:
Philipp Holzer 2019-08-03 20:48:56 +02:00
parent b95d4f41b9
commit d56bd28a07
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
40 changed files with 766 additions and 621 deletions

View file

@ -3,8 +3,10 @@
namespace Friendica\Test\src\Core\Lock;
use Friendica\Factory\CacheDriverFactory;
use Friendica\Core\Cache\MemcachedCacheDriver;
use Friendica\Core\Config\Configuration;
use Friendica\Core\Lock\CacheLockDriver;
use Psr\Log\NullLogger;
/**
* @requires extension memcached
@ -13,11 +15,15 @@ class MemcachedCacheLockDriverTest extends LockTest
{
protected function getInstance()
{
$this->configMock
$configMock = \Mockery::mock(Configuration::class);
$configMock
->shouldReceive('get')
->with('system', 'memcached_hosts')
->andReturn([0 => 'localhost, 11211']);
return new CacheLockDriver(CacheDriverFactory::create('memcached'));
$logger = new NullLogger();
return new CacheLockDriver(new MemcachedCacheDriver('localhost', $configMock, $logger));
}
}