Add a bunch of tests for StatsCaching

This commit is contained in:
Philipp 2025-04-27 01:36:30 +02:00
parent 892fa595da
commit b222aa0c48
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
15 changed files with 477 additions and 43 deletions

View file

@ -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;
}
}