From f0b9704e20b1f6e4ba1842a7c9c83142df954901 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 26 Nov 2024 09:28:57 +0100 Subject: [PATCH] fix test Do not yield Redis Sentinel test data if the required environment variables are not configured. --- Tests/Transport/RedisTransportFactoryTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/Transport/RedisTransportFactoryTest.php b/Tests/Transport/RedisTransportFactoryTest.php index 93e5e89..58c7cf0 100644 --- a/Tests/Transport/RedisTransportFactoryTest.php +++ b/Tests/Transport/RedisTransportFactoryTest.php @@ -66,10 +66,12 @@ public static function createTransportProvider(): iterable ['stream' => 'bar', 'delete_after_ack' => true], ]; - yield 'redis_sentinel' => [ - 'redis:?host['.str_replace(' ', ']&host[', getenv('REDIS_SENTINEL_HOSTS')).']', - ['sentinel_master' => getenv('REDIS_SENTINEL_SERVICE')], - ]; + if (false !== getenv('REDIS_SENTINEL_HOSTS') && false !== getenv('REDIS_SENTINEL_SERVICE')) { + yield 'redis_sentinel' => [ + 'redis:?host['.str_replace(' ', ']&host[', getenv('REDIS_SENTINEL_HOSTS')).']', + ['sentinel_master' => getenv('REDIS_SENTINEL_SERVICE')], + ]; + } } private function skipIfRedisUnavailable()