Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Do not yield Redis Sentinel test data if the required environment variables
are not configured.
  • Loading branch information
xabbuh committed Nov 26, 2024
1 parent 0e9e316 commit f0b9704
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/Transport/RedisTransportFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f0b9704

Please sign in to comment.