mirror of
https://github.com/friendica/friendica
synced 2025-04-27 18:30:12 +00:00
Fix Cache tests
This commit is contained in:
parent
16591077ac
commit
6ad27183a1
7 changed files with 16 additions and 7 deletions
|
@ -35,6 +35,7 @@ class MemcacheCacheTest extends MemoryCacheTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHE_PORT'] ?? '11211';
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
@ -43,7 +44,7 @@ class MemcacheCacheTest extends MemoryCacheTest
|
|||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcache_port')
|
||||
->andReturn(11211);
|
||||
->andReturn($port);
|
||||
|
||||
try {
|
||||
$this->cache = new MemcacheCache($host, $configMock);
|
||||
|
|
|
@ -36,11 +36,12 @@ class MemcachedCacheTest extends MemoryCacheTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHED_PORT'] ?? '11211';
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcached_hosts')
|
||||
->andReturn([0 => $host . ', 11211']);
|
||||
->andReturn([0 => $host . ', ' . $port]);
|
||||
|
||||
$logger = new NullLogger();
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ class RedisCacheTest extends MemoryCacheTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['REDIS_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['REDIS_PORT'] ?? null;
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
@ -43,7 +44,7 @@ class RedisCacheTest extends MemoryCacheTest
|
|||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_port')
|
||||
->andReturn(null);
|
||||
->andReturn($port);
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
|
|
@ -36,6 +36,7 @@ class MemcacheCacheLockTest extends LockTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHE_PORT'] ?? '11211';
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
@ -44,7 +45,7 @@ class MemcacheCacheLockTest extends LockTest
|
|||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcache_port')
|
||||
->andReturn(11211);
|
||||
->andReturn($port);
|
||||
|
||||
$lock = null;
|
||||
|
||||
|
|
|
@ -37,11 +37,12 @@ class MemcachedCacheLockTest extends LockTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHED_PORT'] ?? '11211';
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcached_hosts')
|
||||
->andReturn([0 => $host . ', 11211']);
|
||||
->andReturn([0 => $host . ', ' . $port]);
|
||||
|
||||
$logger = new NullLogger();
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ class RedisCacheLockTest extends LockTest
|
|||
$configMock = \Mockery::mock(IConfig::class);
|
||||
|
||||
$host = $_SERVER['REDIS_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['REDIS_PORT'] ?? null;
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
@ -44,7 +45,7 @@ class RedisCacheLockTest extends LockTest
|
|||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'redis_port')
|
||||
->andReturn(null);
|
||||
->andReturn($port);
|
||||
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue