mirror of
https://github.com/friendica/friendica
synced 2025-04-24 04:30:11 +00:00
Refactor ConfigMockTrait to mocked ConfigCache
This commit is contained in:
parent
38ac615ba0
commit
cb791024e4
27 changed files with 244 additions and 193 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue