MDL-67087 cachestore_redis: fix warning in phpunit
authorMarina Glancy <marina@moodle.com>
Wed, 30 Oct 2019 17:52:22 +0000 (18:52 +0100)
committerMarina Glancy <marina@moodle.com>
Wed, 30 Oct 2019 17:52:22 +0000 (18:52 +0100)
cache/stores/redis/tests/compressor_test.php

index 0d9a583..7f8876e 100644 (file)
@@ -171,6 +171,11 @@ class cachestore_redis_compressor_test extends advanced_testcase {
      * @return array
      */
     public function provider_for_tests_setget() {
+        if (!cachestore_redis::are_requirements_met()) {
+            // Even though we skip all tests in this case, this provider can still show warnings about non-existing class.
+            return [];
+        }
+
         $data = [
             ['none, none',
                 Redis::SERIALIZER_NONE, cachestore_redis::COMPRESSOR_NONE,