[BUGFIX] Implement connection timeout option for Redis backend
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Cache / Backend / RedisBackendTest.php
index 11606e7..22b5139 100644 (file)
@@ -161,6 +161,28 @@ class RedisBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
         $this->setUpBackend(['compressionLevel' => 11]);
     }
 
+    /**
+     * @test Functional
+     */
+    public function setConnectionTimeoutThrowsExceptionIfConnectionTimeoutIsNotInteger()
+    {
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionCode(1487849315);
+
+        $this->setUpBackend(['connectionTimeout' => 'foo']);
+    }
+
+    /**
+     * @test Functional
+     */
+    public function setConnectionTimeoutThrowsExceptionIfConnectionTimeoutIsNegative()
+    {
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionCode(1487849326);
+
+        $this->setUpBackend(['connectionTimeout' => -1]);
+    }
+
     /**
      * @test Functional
      */