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 * @group relay-incompatible * @return void * @requiresRedisVersion >= 8.0.0 */ public function testReturnsAndRemoveFieldsFromHash(): void { $redis = $this->getClient(); $redis->hset('hashkey', 'field1', 'value1', 'field2', 'value2', 'field3', 'value3'); $this->assertSame(['value1', 'value2'], $redis->hgetdel('hashkey', ['field1', 'field2'])); $this->assertSame(['field3' => 'value3'], $redis->hgetall('hashkey')); } }