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

@ -8,15 +8,20 @@ use Friendica\Core\Lock\CacheLockDriver;
/**
* @requires extension redis
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
class RedisCacheLockDriverTest extends LockTest
{
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);
return new CacheLockDriver(CacheDriverFactory::create('redis'));
}