Improved connection handshake session (#1431)

* Added pipelining for on-connection commands

* Added server version condition for tests

* Fixed static analysis and codestyle errors

* Improved handshake session

* Updated HELLO retry logic

* Changed incorrect variable

* Added return statement

* Added more test coverage, codestyle fixes
This commit is contained in:
Vladyslav Vildanov
2024-03-04 09:18:46 +02:00
committed by GitHub
parent 4b28ab1c74
commit 8b464f2a60
16 changed files with 398 additions and 55 deletions
@@ -13,6 +13,7 @@
namespace Predis\Connection;
use Predis\Command\RawCommand;
use Predis\NotSupportedException;
use Predis\Response\Error as ErrorResponse;
use PredisTestCase;
use Relay\Relay;
@@ -61,6 +62,28 @@ class RelayConnectionTest extends PredisTestCase
$this->assertTrue($this->connection->isConnected());
}
/**
* @group disconnected
*/
public function testReadThrowsException(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage('The "relay" extension does not support reading responses.');
$this->connection->read();
}
/**
* @group disconnected
*/
public function testWriteThrowsException(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage('The "relay" extension does not support writing operations.');
$this->connection->write('foobar');
}
/**
* @group disconnected
* @return void