]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Cache/MemcachedCacheDriverTest.php
Merge branch 'develop' of https://github.com/friendica/friendica into develop
[friendica.git] / tests / src / Core / Cache / MemcachedCacheDriverTest.php
index ff76ddefc48c3fec9daeab1f2607ac71cbf75b3c..fba5c4a958c4347053305c948b0b40a03db271ff 100644 (file)
@@ -6,34 +6,20 @@ namespace Friendica\Test\src\Core\Cache;
 
 use Friendica\Core\Cache\CacheDriverFactory;
 
-class MemcachedCacheDriverTest extends CacheTest
+/**
+ * @requires extension memcached
+ */
+class MemcachedCacheDriverTest extends MemoryCacheTest
 {
-       /**
-        * @var \Friendica\Core\Cache\IMemoryCacheDriver
-        */
-       private $cache;
-
        protected function getInstance()
        {
-               if (class_exists('Memcached')) {
-                       try {
-                               $this->cache = CacheDriverFactory::create('memcached');
-                       } catch (\Exception $exception) {
-                               print "Memcached - TestCase failed: " . $exception->getMessage();
-                               throw new \Exception();
-                       }
-                       return $this->cache;
-               } else {
-                       $this->markTestSkipped('Memcached driver isn\'t available');
-                       return null;
-               }
+               $this->cache = CacheDriverFactory::create('memcached');
+               return $this->cache;
        }
 
        public function tearDown()
        {
-               if (class_exists('Memcached')) {
-                       $this->cache->clear();
-               }
+               $this->cache->clear(false);
                parent::tearDown();
        }
 }