namespace Friendica\Test\src\Core\Lock;
-
-use Friendica\Core\Cache\CacheDriverFactory;
+use Friendica\Factory\CacheDriverFactory;
use Friendica\Core\Lock\CacheLockDriver;
/**
*/
class MemcacheCacheLockDriverTest extends LockTest
{
- /**
- * @var \Friendica\Core\Cache\IMemoryCacheDriver
- */
- private $cache;
-
protected function getInstance()
{
- $this->cache = CacheDriverFactory::create('memcache');
- return new CacheLockDriver($this->cache);
- }
+ $this->configMock
+ ->shouldReceive('get')
+ ->with('system', 'memcache_host')
+ ->andReturn('localhost');
- public function tearDown()
- {
- $this->cache->clear();
- parent::tearDown();
+ $this->configMock
+ ->shouldReceive('get')
+ ->with('system', 'memcache_port')
+ ->andReturn(11211);
+
+ return new CacheLockDriver(CacheDriverFactory::create('memcache'));
}
}