getCommand(); $command->setArguments($arguments); $this->assertSame($expected, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $raw = ['ssubscribe', 'channel', 1]; $expected = ['ssubscribe', 'channel', 1]; $command = $this->getCommand(); $this->assertSame($expected, $command->parseResponse($raw)); } /** * @group connected * @group relay-incompatible * @requiresRedisVersion >= 7.0.0 */ public function testSubscribesToGivenShardedChannels(): void { $redis = $this->getClient(); $this->assertSame(['ssubscribe', 'channel1', 1], $redis->ssubscribe('channel1')); } /** * @group connected * @group relay-incompatible * @requiresRedisVersion >= 7.0.0 */ public function testAllowsSUnsubscribeAfterSSubscribe(): void { $redis = $this->getClient(); $this->assertSame(['ssubscribe', 'channel1', 1], $redis->ssubscribe('channel1')); $this->assertSame(['sunsubscribe', 'channel1', 0], $redis->sunsubscribe('channel1')); } /** * @group connected * @group relay-incompatible * @requiresRedisVersion >= 7.0.0 */ public function testCannotSendOtherCommandsAfterSSubscribe(): void { $this->expectException(ServerException::class); $this->expectExceptionMessageMatches('/ERR.*only .* allowed in this context/'); $redis = $this->getClient(); $redis->ssubscribe('channel:foo'); $redis->set('foo', 'bar'); } }