getCommand(); $command->setArguments($actualArguments); $this->assertSameValues($expectedArguments, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $actualResponse = ['width', 2000, 'depth', 10, 'count', 0]; $expectedResponse = ['width' => 2000, 'depth' => 10, 'count' => 0]; $this->assertSame($expectedResponse, $this->getCommand()->parseResponse($actualResponse)); } /** * @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.0.0 */ public function testReturnsInfoAboutGivenCountMinSketch(): void { $redis = $this->getClient(); $expectedResponse = ['width' => 2000, 'depth' => 10, 'count' => 0]; $redis->cmsinitbydim('key', 2000, 10); $actualResponse = $redis->cmsinfo('key'); $this->assertSame($expectedResponse, $actualResponse); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisBfVersion >= 2.6.0 */ public function testReturnsInfoAboutGivenCountMinSketchResp3(): void { $redis = $this->getResp3Client(); $expectedResponse = ['width' => 2000, 'depth' => 10, 'count' => 0]; $redis->cmsinitbydim('key', 2000, 10); $actualResponse = $redis->cmsinfo('key'); $this->assertSame($expectedResponse, $actualResponse); } /** * @group connected * @group relay-resp3 * @requiresRedisBfVersion >= 2.0.0 */ public function testThrowsExceptionOnNonExistingKey(): void { $this->expectException(ServerException::class); $this->expectExceptionMessage('CMS: key does not exist'); $redis = $this->getClient(); $redis->cmsinfo('cmsinfo_foo'); } }