Fixed client_info connection parameter being ignored (#1722)

* Fixed `client_info` connection parameter being ignored
* Documented the default value of the `client_info` parameter
This commit is contained in:
Lazizbek Ergashev
2026-09-11 03:24:31 +05:00
committed by GitHub
parent 3a8c350f3d
commit e7b89c14b7
4 changed files with 28 additions and 7 deletions
+18
View File
@@ -585,6 +585,24 @@ class FactoryTest extends PredisTestCase
$this->assertSame(['SETINFO', 'LIB-VER', Client::VERSION], $initCommands[2]->getArguments());
}
/**
* @group disconnected
* @return void
*/
public function testDoesNotSetClientNameAndVersionOnConnectionWithClientInfoDisabled(): void
{
$parameters = ['client_info' => false];
$factory = new Factory();
$connection = $factory->create($parameters);
$initCommands = $connection->getInitCommands();
$this->assertCount(1, $initCommands);
$this->assertInstanceOf(RawCommand::class, $initCommands[0]);
$this->assertSame('HELLO', $initCommands[0]->getId());
$this->assertSame([2, 'SETNAME', 'predis'], $initCommands[0]->getArguments());
}
/**
* @group disconnected
*/