getCommand(); $command->setArguments(['key', ['field1', 'field2']]); $this->assertSame(['key', 'FIELDS', 2, 'field1', 'field2'], $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $command = $this->getCommand(); $this->assertSame(0, $command->parseResponse(0)); $this->assertSame(1, $command->parseResponse(1)); } /** * @group connected * @return void * @requiresRedisVersion >= 7.3.0 */ public function testReturnsExpirationTimestamp(): void { $redis = $this->getClient(); $redis->hset('hashkey', 'field1', 'value1', 'field2', 'value2'); $expireAt = (time() + 10) * 1000; $this->assertSame([1, 1], $redis->hpexpireat('hashkey', $expireAt, ['field1', 'field2'])); $this->assertSame([$expireAt, $expireAt], $redis->hpexpiretime('hashkey', ['field1', 'field2'])); $this->assertSame([-2], $redis->hexpiretime('wrongkey', ['field1'])); } }