mirror of
https://github.com/predis/predis.git
synced 2026-09-26 19:25:45 +00:00
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:
committed by
GitHub
parent
3a8c350f3d
commit
e7b89c14b7
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user