From 0e0102b6fcd17266f39dd63a808740d01ab9bd8a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 24 Sep 2016 19:57:59 +0200 Subject: =?UTF-8?q?Avoid=20failing=20test=20for=20user=20who=20didn?= =?UTF-8?q?=E2=80=99t=20install=20Redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Wallabag/CoreBundle/WallabagCoreTestCase.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/Wallabag/CoreBundle/WallabagCoreTestCase.php') diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index c0055888..75b7ee0b 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php @@ -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' + ); + } + } } -- cgit v1.2.3