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,15 +6,16 @@ namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\CacheDriverFactory;
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @requires extension memcached
*/
class MemcachedCacheDriverTest extends MemoryCacheTest
{
protected function getInstance()
{
$this->mockConfigGet('system', 'memcached_hosts', [0 => 'localhost, 11211']);
$this->configCache
->shouldReceive('get')
->with('system', 'memcached_hosts', NULL)
->andReturn([0 => 'localhost, 11211']);
$this->cache = CacheDriverFactory::create('memcached');
return $this->cache;