getCommand(); $command->setArguments($actualArguments); $this->assertSameValues($expectedArguments, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisBfVersion >= 2.4.0 */ public function testReturnsReversedRanksOfGivenObservationsValue(): void { $redis = $this->getClient(); $expectedResponse = [3, 2, 1, 0, -1]; $redis->tdigestcreate('key'); $redis->tdigestcreate('empty_key'); $redis->tdigestadd('key', 10, 20, 30); $actualResponse = $redis->tdigestrevrank('key', 0, 10, 20, 30, 40); $this->assertSame($expectedResponse, $actualResponse); $this->assertSame([-2, -2, -2], $redis->tdigestrank('empty_key', 1, 2, 3)); } /** * @group connected * @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->tdigestrevrank('key', 1, 2, 3); } }