Skip to content

Commit 4d0d05a

Browse files
committed
minor symfony#61674 [Messenger] fix test setup (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Messenger] fix test setup | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 3c974e3 fix test setup
2 parents 991b8ef + 3c974e3 commit 4d0d05a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,18 +412,18 @@ public function testInvalidSentinelMasterName()
412412
$this->markTestSkipped('REDIS_SENTINEL_HOSTS env var is not defined.');
413413
}
414414

415+
if (!getenv('MESSENGER_REDIS_SENTINEL_MASTER')) {
416+
self::markTestSkipped('Redis sentinel is not configured');
417+
}
418+
415419
$dsn = 'redis:?host['.str_replace(' ', ']&host[', $hosts).']';
416420

417421
try {
418-
Connection::fromDsn($dsn, ['delete_after_ack' => true]);
422+
Connection::fromDsn($dsn, ['delete_after_ack' => true, 'sentinel_master' => getenv('MESSENGER_REDIS_SENTINEL_MASTER')]);
419423
} catch (\Exception $e) {
420424
self::markTestSkipped($e->getMessage());
421425
}
422426

423-
if (!getenv('MESSENGER_REDIS_SENTINEL_MASTER')) {
424-
self::markTestSkipped('Redis sentinel is not configured');
425-
}
426-
427427
$uid = uniqid('sentinel_', true);
428428

429429
$this->expectException(\InvalidArgumentException::class);

0 commit comments

Comments
 (0)