Disable CLIENT SETINFO calls by default (#1399)

Add `client_info` parameter
This commit is contained in:
Till Krüss
2023-09-13 09:35:49 -07:00
committed by GitHub
parent c6bf644872
commit cbf394b882
4 changed files with 28 additions and 30 deletions
+16 -1
View File
@@ -1258,12 +1258,27 @@ class ClientTest extends PredisTestCase
* @group relay-incompatible
* @requiresRedisVersion >= 7.2.0
*/
public function testSetClientInfoOnConnection(): void
public function testDoNoSetClientInfoOnConnection(): void
{
$client = new Client($this->getParameters());
$libName = $client->client('LIST')[0]['lib-name'];
$libVer = $client->client('LIST')[0]['lib-ver'];
$this->assertEmpty($libName);
$this->assertEmpty($libVer);
}
/**
* @group connected
* @group relay-incompatible
* @requiresRedisVersion >= 7.2.0
*/
public function testSetClientInfoOnConnectionWhenEnabled(): void
{
$client = new Client($this->getParameters(['client_info' => true]));
$libName = $client->client('LIST')[0]['lib-name'];
$libVer = $client->client('LIST')[0]['lib-ver'];
$this->assertSame('predis', $libName);
$this->assertSame(Client::VERSION, $libVer);
}