RedisClusterCacheTest.php 786 B

123456789101112131415161718192021222324252627282930
  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. /**
  12. * @group legacy
  13. */
  14. class RedisClusterCacheTest extends AbstractRedisCacheTest
  15. {
  16. public static function setUpBeforeClass(): void
  17. {
  18. if (!class_exists('RedisCluster')) {
  19. self::markTestSkipped('The RedisCluster class is required.');
  20. }
  21. if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
  22. self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
  23. }
  24. self::$redis = new \RedisCluster(null, explode(' ', $hosts));
  25. }
  26. }