getCommand(); $command->setArguments($arguments); $this->assertSameValues($expected, $command->getArguments()); } /** * @group disconnected */ public function testHelpFilterArguments(): void { $arguments = ['HELP', 'option']; $expected = ['HELP', 'option']; $command = $this->getCommand(); $command->setArguments($arguments); $this->assertSameValues($expected, $command->getArguments()); } /** * @group disconnected */ public function testSetFilterArguments(): void { $arguments = ['SET', 'option', 'value']; $expected = ['SET', 'option', 'value']; $command = $this->getCommand(); $command->setArguments($arguments); $this->assertSameValues($expected, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisVersion <= 7.0.0 */ public function testSetGivenRediSearchConfigurationParameter(): void { $redis = $this->getClient(); $this->assertEquals('OK', $redis->ftconfig->set('TIMEOUT', 42)); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisVersion <= 7.0.0 */ public function testGetReturnsGivenRediSearchConfigurationParameter(): void { $redis = $this->getClient(); $this->assertEquals([['MAXEXPANSIONS', '200']], $redis->ftconfig->get('MAXEXPANSIONS')); $this->assertEmpty($redis->ftconfig->get('foobar')); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisVersion <= 7.0.0 */ public function testHelpReturnsGivenRediSearchConfigurationDescription(): void { $redis = $this->getClient(); $expectedResponse = [ [ 'MAXEXPANSIONS', 'Description', 'Maximum prefix expansions to be used in a query', 'Value', '200', ], ]; $this->assertEquals($expectedResponse, $redis->ftconfig->help('MAXEXPANSIONS')); $this->assertEmpty($redis->ftconfig->help('foobar')); } /** * @group connected * @group relay-resp3 * @return void * @requiresRedisVersion <= 7.0.0 */ public function testSetThrowsExceptionOnNonExistingOption(): void { $redis = $this->getClient(); $this->expectException(ServerException::class); $redis->ftconfig->set('foobar', 'value'); } }