]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Cache/RedisCacheDriverTest.php
Merge pull request #6079 from annando/issue-dir-15
[friendica.git] / tests / src / Core / Cache / RedisCacheDriverTest.php
index 44ff0d42b1c9c3071f0bba54a0e07a274000a245..17079f1e0699c6f7476b5be997678979a8788e4f 100644 (file)
@@ -3,37 +3,26 @@
 
 namespace Friendica\Test\src\Core\Cache;
 
-
+/**
+ * @runTestsInSeparateProcesses
+ * @preserveGlobalState disabled
+ */
 use Friendica\Core\Cache\CacheDriverFactory;
 
-class RedisCacheDriverTest extends CacheTest
+/**
+ * @requires extension redis
+ */
+class RedisCacheDriverTest extends MemoryCacheTest
 {
-       /**
-        * @var \Friendica\Core\Cache\IMemoryCacheDriver
-        */
-       private $cache;
-
        protected function getInstance()
        {
-               if (class_exists('Redis')) {
-                       try {
-                               $this->cache = CacheDriverFactory::create('redis');
-                       } catch (\Exception $exception) {
-                               print "Redis - TestCase failed: " . $exception->getMessage();
-                               throw new \Exception();
-                       }
-                       return $this->cache;
-               } else {
-                       $this->markTestSkipped('Redis driver isn\'t available');
-                       return null;
-               }
+               $this->cache = CacheDriverFactory::create('redis');
+               return $this->cache;
        }
 
        public function tearDown()
        {
-               if (class_exists('Redis')) {
-                       $this->cache->clear();
-               }
+               $this->cache->clear(false);
                parent::tearDown();
        }
 }