Adding possibility to use a different cache-backend for locking and caching

- Renaming *LockDriver to *Lock since it isn't a "driver" anymore
This commit is contained in:
Philipp Holzer 2019-08-04 15:42:39 +02:00
commit 34e4968c06
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
19 changed files with 149 additions and 64 deletions

View file

@ -4,8 +4,11 @@ namespace functional;
use Dice\Dice;
use Friendica\App;
use Friendica\Core\Cache\ICache;
use Friendica\Core\Cache\IMemoryCache;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\Configuration;
use Friendica\Core\Lock\ILock;
use Friendica\Database\Database;
use Friendica\Test\Util\VFSTrait;
use Friendica\Util\BasePath;
@ -133,6 +136,31 @@ class dependencyCheck extends TestCase
/** @var LoggerInterface $logger */
$logger = $this->dice->create('$devLogger', ['dev']);
self::assertInstanceOf(LoggerInterface::class, $logger);
$this->assertInstanceOf(LoggerInterface::class, $logger);
}
public function testCache()
{
/** @var ICache $cache */
$cache = $this->dice->create(ICache::class);
$this->assertInstanceOf(ICache::class, $cache);
}
public function testMemoryCache()
{
/** @var IMemoryCache $cache */
$cache = $this->dice->create(IMemoryCache::class);
// We need to check "just" ICache, because the default Cache is DB-Cache, which isn't a memorycache
$this->assertInstanceOf(ICache::class, $cache);
}
public function testLock()
{
/** @var ILock $cache */
$lock = $this->dice->create(ILock::class);
$this->assertInstanceOf(ILock::class, $lock);
}
}