PredisRedisClusterAdapterTest.php 892 B

12345678910111213141516171819202122232425262728293031
  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\Adapter;
  11. use Symfony\Component\Cache\Adapter\RedisAdapter;
  12. class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest
  13. {
  14. public static function setUpBeforeClass(): void
  15. {
  16. if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
  17. self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
  18. }
  19. self::$redis = RedisAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['class' => \Predis\Client::class, 'redis_cluster' => true]);
  20. }
  21. public static function tearDownAfterClass(): void
  22. {
  23. self::$redis = null;
  24. }
  25. }