mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Add a bunch of tests for StatsCaching
This commit is contained in:
parent
892fa595da
commit
b222aa0c48
15 changed files with 477 additions and 43 deletions
|
@ -7,26 +7,39 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
|
||||
use Friendica\Core\Cache\Type\APCuCache;
|
||||
use Friendica\Core\Lock\Capability\ICanLock;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Friendica\Test\CacheLockTestCase;
|
||||
|
||||
/**
|
||||
* @group APCU
|
||||
*/
|
||||
class APCuCacheLockTest extends LockTestCase
|
||||
class APCuCacheLockTest extends CacheLockTestCase
|
||||
{
|
||||
private APCuCache $cache;
|
||||
private ICanLock $lock;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
if (!APCuCache::isAvailable()) {
|
||||
static::markTestSkipped('APCu is not available');
|
||||
}
|
||||
|
||||
$this->cache = new APCuCache('localhost');
|
||||
$this->lock = new CacheLock($this->cache);
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
protected function getInstance()
|
||||
protected function getInstance(): CacheLock
|
||||
{
|
||||
return new CacheLock(new APCuCache('localhost'));
|
||||
return $this->lock;
|
||||
}
|
||||
|
||||
protected function getCache(): ICanCacheInMemory
|
||||
{
|
||||
return $this->cache;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue