getCommand(); $command->setArguments($actualArguments); $this->assertSameValues($expectedArguments, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group disconnected */ public function testPrefixKeys(): void { /** @var PrefixableCommand $command */ $command = $this->getCommand(); $actualArguments = ['arg1']; $prefix = 'prefix:'; $expectedArguments = ['prefix:arg1']; $command->setArguments($actualArguments); $command->prefixKeys($prefix); $this->assertSame($expectedArguments, $command->getArguments()); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisBfVersion >= 2.4.0 */ public function testAddObservationsIntoGivenTDigestSketch(): void { $redis = $this->getClient(); $redis->tdigestcreate('key'); $actualResponse = $redis->tdigestadd('key', 1, 2, 3); $info = $redis->tdigestinfo('key'); $this->assertEquals('OK', $actualResponse); $this->assertSame(3, $info['Observations']); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisBfVersion >= 2.6.0 */ public function testAddObservationsIntoGivenTDigestSketchResp3(): void { $redis = $this->getResp3Client(); $redis->tdigestcreate('key'); $actualResponse = $redis->tdigestadd('key', 1, 2, 3); $info = $redis->tdigestinfo('key'); $this->assertEquals('OK', $actualResponse); $this->assertSame(3, $info['Observations']); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisBfVersion >= 2.4.0 */ public function testThrowsExceptionOnNonExistingTDigestSketch(): void { $redis = $this->getClient(); $this->expectException(ServerException::class); $this->expectExceptionMessage('ERR T-Digest: key does not exist'); $redis->tdigestadd('key', 1, 2, 3); } }