private \Redis|Relay|null
$redis = null;
private ?Connection
$connection = null;
protected function setUp(): void
{ if (!
getenv('MESSENGER_REDIS_DSN'
)) { $this->
markTestSkipped('The "MESSENGER_REDIS_DSN" environment variable is required.'
);
} try { $this->redis =
$this->
createRedisClient();
$this->connection = Connection::
fromDsn(getenv('MESSENGER_REDIS_DSN'
),
['sentinel_master' =>
getenv('MESSENGER_REDIS_SENTINEL_MASTER'
) ?: null
],
$this->redis
);
$this->connection->
cleanup();
$this->connection->
setup();
} catch (\Exception
$e) { self::
markTestSkipped($e->
getMessage());
} } public function testConnectionSendAndGet() { $this->connection->
add('{"message": "Hi"}',
['type' => DummyMessage::
class]);