RedisClusterCacheTest.php 755 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Cache\Tests\Simple;
  11. class RedisClusterCacheTest extends AbstractRedisCacheTest
  12. {
  13. public static function setupBeforeClass()
  14. {
  15. if (!class_exists('RedisCluster')) {
  16. self::markTestSkipped('The RedisCluster class is required.');
  17. }
  18. if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
  19. self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
  20. }
  21. self::$redis = new \RedisCluster(null, explode(' ', $hosts));
  22. }
  23. }