/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Lock/Tests/Store/RelayClusterStoreTest.php
47 строк
1 KB
Nicolas Grekas
Fix tests for RelayCluster
31 мар 2026, 10:11
31 мар 2026, 10:11
88b0556
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Store; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Relay\Cluster as RelayCluster; use Symfony\Component\Lock\Tests\Store\AbstractRedisStoreTestCase; #[RequiresPhpExtension('relay')] #[Group('integration')] class RelayClusterStoreTest extends AbstractRedisStoreTestCase { protected function setUp(): void { $relayCluster = $this->getRedisConnection(); foreach ($relayCluster->_masters() as $hostAndPort) { $relayCluster->flushdb($hostAndPort); } } public static function setUpBeforeClass(): void { if (!class_exists(RelayCluster::class)) { self::markTestSkipped('The Relay\Cluster class is required.'); } if (false === getenv('REDIS_CLUSTER_HOSTS')) { self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.'); } } protected function getRedisConnection(): RelayCluster { return new RelayCluster(null, explode(' ', getenv('REDIS_CLUSTER_HOSTS'))); } }