mirror of
https://github.com/predis/predis.git
synced 2026-10-09 13:26:57 +00:00
Client set lib and version on connection (#1351)
* Added client metadata on server connection * Added try...catch around server exception to supress CLIENT command errors * Added exclusion for Relay connection * Changed array index
This commit is contained in:
committed by
GitHub
parent
d8da27ba02
commit
af236dc50a
@@ -13,6 +13,7 @@
|
||||
namespace Predis\Connection;
|
||||
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Predis\Client;
|
||||
use Predis\Command\RawCommand;
|
||||
use Predis\Response\Error as ErrorResponse;
|
||||
|
||||
@@ -196,6 +197,24 @@ class StreamConnectionTest extends PredisConnectionTestCase
|
||||
$this->assertFalse($options['socket']['tcp_nodelay']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @requiresRedisVersion < 7.0.0
|
||||
*/
|
||||
public function testConnectDoNotThrowsExceptionOnClientCommandError(): void
|
||||
{
|
||||
$connection = $this->createConnectionWithParams([]);
|
||||
$connection->addConnectCommand(
|
||||
new RawCommand('CLIENT', ['SETINFO', 'LIB-NAME', 'predis'])
|
||||
);
|
||||
$connection->addConnectCommand(
|
||||
new RawCommand('CLIENT', ['SETINFO', 'LIB-VER', Client::VERSION])
|
||||
);
|
||||
|
||||
$connection->connect();
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
* @return void
|
||||
|
||||
Reference in New Issue
Block a user