getCommand(); $command->setArguments($actualArguments); $this->assertSameValues($expectedArguments, $command->getArguments()); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisTimeSeriesVersion >= 1.0.0 */ public function testQueryReturnsKeysMatchingGivenFilterExpression(): void { $redis = $this->getClient(); $arguments = (new CreateArguments()) ->labels('type', 'temp', 'location', 'TLV'); $this->assertEquals('OK', $redis->tscreate('temp:TLV', $arguments)); $anotherArguments = (new CreateArguments()) ->labels('type', 'temp', 'location', 'JER'); $this->assertEquals('OK', $redis->tscreate('temp:JER', $anotherArguments)); $this->assertSame(['temp:TLV'], $redis->tsqueryindex('location=TLV')); } /** * @group connected * @return void * @requiresRedisTimeSeriesVersion >= 1.0.0 */ public function testQueryReturnsKeysMatchingGivenFilterExpressionResp3(): void { $redis = $this->getResp3Client(); $arguments = (new CreateArguments()) ->labels('type', 'temp', 'location', 'TLV'); $this->assertEquals('OK', $redis->tscreate('temp:TLV', $arguments)); $anotherArguments = (new CreateArguments()) ->labels('type', 'temp', 'location', 'JER'); $this->assertEquals('OK', $redis->tscreate('temp:JER', $anotherArguments)); $this->assertSame(['temp:TLV'], $redis->tsqueryindex('location=TLV')); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisTimeSeriesVersion >= 1.0.0 */ public function testThrowsExceptionOnInvalidFilterExpression(): void { $redis = $this->getClient(); $this->expectException(ServerException::class); $this->expectExceptionMessage('ERR TSDB: failed parsing labels'); $redis->tsqueryindex('wrong'); } }