2018-07-07 17:46:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Friendica\Test\src\Core\Cache;
|
|
|
|
|
2019-08-04 08:26:53 +00:00
|
|
|
use Friendica\Core\Cache\MemcachedCache;
|
2019-08-03 18:48:56 +00:00
|
|
|
use Friendica\Core\Config\Configuration;
|
|
|
|
use Psr\Log\NullLogger;
|
2018-07-07 17:46:16 +00:00
|
|
|
|
2018-07-18 19:04:18 +00:00
|
|
|
/**
|
|
|
|
* @requires extension memcached
|
|
|
|
*/
|
2019-08-04 08:26:53 +00:00
|
|
|
class MemcachedCacheTest extends MemoryCacheTest
|
2018-07-07 17:46:16 +00:00
|
|
|
{
|
|
|
|
protected function getInstance()
|
|
|
|
{
|
2019-08-03 18:48:56 +00:00
|
|
|
$configMock = \Mockery::mock(Configuration::class);
|
|
|
|
|
|
|
|
$configMock
|
2019-02-07 19:44:03 +00:00
|
|
|
->shouldReceive('get')
|
2019-02-17 20:41:45 +00:00
|
|
|
->with('system', 'memcached_hosts')
|
2019-02-07 19:44:03 +00:00
|
|
|
->andReturn([0 => 'localhost, 11211']);
|
2019-01-30 19:26:17 +00:00
|
|
|
|
2019-08-03 18:48:56 +00:00
|
|
|
$logger = new NullLogger();
|
|
|
|
|
2019-08-04 08:26:53 +00:00
|
|
|
$this->cache = new MemcachedCache('localhost', $configMock, $logger);
|
2018-07-18 19:04:18 +00:00
|
|
|
return $this->cache;
|
2018-07-07 17:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
2018-07-18 19:04:18 +00:00
|
|
|
$this->cache->clear(false);
|
2018-07-07 17:46:16 +00:00
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
}
|