Refactor ConfigMockTrait to mocked ConfigCache

This commit is contained in:
Philipp Holzer 2019-02-07 20:44:03 +01:00
parent 38ac615ba0
commit cb791024e4
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
27 changed files with 244 additions and 193 deletions

View file

@ -6,16 +6,21 @@ namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\CacheDriverFactory;
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @requires extension redis
*/
class RedisCacheDriverTest extends MemoryCacheTest
{
protected function getInstance()
{
$this->mockConfigGet('system', 'redis_host', 'localhost', 1);
$this->mockConfigGet('system', 'redis_port', null, 1);
$this->configCache
->shouldReceive('get')
->with('system', 'redis_host', NULL)
->andReturn('localhost');
$this->configCache
->shouldReceive('get')
->with('system', 'redis_port', NULL)
->andReturn(null);
$this->cache = CacheDriverFactory::create('redis');
return $this->cache;