[BUGFIX] Skip failing unit tests if preconditions not available 36/51636/2
authorNicole Cordes <typo3@cordes.co>
Sat, 11 Feb 2017 15:52:10 +0000 (16:52 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 11 Feb 2017 16:00:05 +0000 (17:00 +0100)
The unit tests for RedisSessionBackendTest rely on a class \Redis
which might not be available on all systems. Therefore the tests
should be skipped to not fail.

Resolves: #79758
Releases: master
Change-Id: Ie14911e7ba90eaffd32585c1c18d642996bbf74c
Reviewed-on: https://review.typo3.org/51636
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Tests/Unit/Session/Backend/RedisSessionBackendTest.php

index 795ba61..77941d5 100644 (file)
@@ -23,6 +23,13 @@ use TYPO3\Components\TestingFramework\Core\Unit\UnitTestCase;
  */
 class RedisSessionBackendTest extends UnitTestCase
 {
+    protected function setUp()
+    {
+        if (!class_exists(\Redis::class)) {
+            $this->markTestSkipped('Redis class needs to be available to test RedisSessionBackend');
+        }
+    }
+
     /**
      * @test
      */