mirror of
https://github.com/friendica/friendica
synced 2025-05-01 01:04:36 +02: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 memcache
|
||||
*/
|
||||
class MemcacheCacheDriverTest extends MemoryCacheTest
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
$this->mockConfigGet('system', 'memcache_host', 'localhost', 1);
|
||||
$this->mockConfigGet('system', 'memcache_port', 11211, 1);
|
||||
$this->configCache
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcache_host', NULL)
|
||||
->andReturn('localhost');
|
||||
|
||||
$this->configCache
|
||||
->shouldReceive('get')
|
||||
->with('system', 'memcache_port', NULL)
|
||||
->andReturn(11211);
|
||||
|
||||
$this->cache = CacheDriverFactory::create('memcache');
|
||||
return $this->cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue