@@ -36,7 +36,7 @@ protected function setUp(): void
36
36
37
37
try {
38
38
$ this ->redis = new \Redis ();
39
- $ this ->connection = Connection::fromDsn (getenv ('MESSENGER_REDIS_DSN ' ), ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' )], $ this ->redis );
39
+ $ this ->connection = Connection::fromDsn (getenv ('MESSENGER_REDIS_DSN ' ), ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ) ?: null ], $ this ->redis );
40
40
$ this ->connection ->cleanup ();
41
41
$ this ->connection ->setup ();
42
42
} catch (\Exception $ e ) {
@@ -144,7 +144,7 @@ public function testConnectionSendDelayedMessagesWithSameContent()
144
144
public function testConnectionBelowRedeliverTimeout ()
145
145
{
146
146
// lower redeliver timeout and claim interval
147
- $ connection = Connection::fromDsn (getenv ('MESSENGER_REDIS_DSN ' ), ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' )], $ this ->redis );
147
+ $ connection = Connection::fromDsn (getenv ('MESSENGER_REDIS_DSN ' ), ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ) ?: null ], $ this ->redis );
148
148
149
149
$ connection ->cleanup ();
150
150
$ connection ->setup ();
@@ -172,7 +172,7 @@ public function testConnectionClaimAndRedeliver()
172
172
// lower redeliver timeout and claim interval
173
173
$ connection = Connection::fromDsn (
174
174
getenv ('MESSENGER_REDIS_DSN ' ),
175
- ['redeliver_timeout ' => 0 , 'claim_interval ' => 500 , 'sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' )],
175
+ ['redeliver_timeout ' => 0 , 'claim_interval ' => 500 , 'sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ) ?: null ],
176
176
177
177
$ this ->redis
178
178
);
@@ -222,7 +222,8 @@ public function testLazySentinel()
222
222
$ connection = Connection::fromDsn (getenv ('MESSENGER_REDIS_DSN ' ),
223
223
['lazy ' => true ,
224
224
'delete_after_ack ' => true ,
225
- 'sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ), ], $ this ->redis );
225
+ 'sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ) ?: null ,
226
+ ], $ this ->redis );
226
227
227
228
$ connection ->add ('1 ' , []);
228
229
$ this ->assertNotEmpty ($ message = $ connection ->get ());
@@ -240,11 +241,7 @@ public function testLazyCluster()
240
241
{
241
242
$ this ->skipIfRedisClusterUnavailable ();
242
243
243
- $ connection = new Connection (
244
- ['lazy ' => true ],
245
- ['host ' => explode (' ' , getenv ('REDIS_CLUSTER_HOSTS ' ))],
246
- []
247
- );
244
+ $ connection = new Connection (['lazy ' => true , 'host ' => explode (' ' , getenv ('REDIS_CLUSTER_HOSTS ' ))]);
248
245
249
246
$ connection ->add ('1 ' , []);
250
247
$ this ->assertNotEmpty ($ message = $ connection ->get ());
@@ -293,7 +290,7 @@ public function testFromDsnWithMultipleHosts()
293
290
$ dsn = array_map (fn ($ host ) => 'redis:// ' .$ host , $ hosts );
294
291
$ dsn = implode (', ' , $ dsn );
295
292
296
- $ this ->assertInstanceOf (Connection::class, Connection::fromDsn ($ dsn , ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' )]));
293
+ $ this ->assertInstanceOf (Connection::class, Connection::fromDsn ($ dsn , ['sentinel_master ' => getenv ('MESSENGER_REDIS_SENTINEL_MASTER ' ) ?: null ]));
297
294
}
298
295
299
296
public function testJsonError ()
0 commit comments