]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/WallabagCoreTestCase.php
Avoid failing test for user who didn’t install Redis
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / WallabagCoreTestCase.php
index c0055888a255eaa44aa88d52f5630ff50e5c6147..75b7ee0bd4a110437cdd226455eea0dda7634304 100644 (file)
@@ -80,4 +80,19 @@ abstract class WallabagCoreTestCase extends WebTestCase
 
         throw new \RuntimeException('No logged in User.');
     }
+
+    /**
+     * Check if Redis is installed.
+     * If not, mark test as skip
+     */
+    protected function checkRedis()
+    {
+        try {
+            $this->client->getContainer()->get('wallabag_core.redis.client')->connect();
+        } catch (\Exception $e) {
+            $this->markTestSkipped(
+              'Redis is not installed/activated'
+            );
+        }
+    }
 }