mirror of
https://github.com/predis/predis.git
synced 2026-10-08 21:06:44 +00:00
[tests] Start improving test suite.
- Make use of more typehints for function parameters - Make use of typehints for function return values - Use @var where needed to give proper hints to IDEs and avoid warnings - Replace MockObject::setMethods() with addMethods() and onlyMethods() - Rewording of some phpdocs
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Predis\Protocol\Text;
|
||||
|
||||
use PredisTestCase;
|
||||
use Predis\Protocol\Text\Handler\ResponseHandlerInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,7 +22,7 @@ class ResponseReaderTest extends PredisTestCase
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testDefaultHandlers()
|
||||
public function testDefaultHandlers(): void
|
||||
{
|
||||
$reader = new ResponseReader();
|
||||
|
||||
@@ -37,8 +38,9 @@ class ResponseReaderTest extends PredisTestCase
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testReplaceHandler()
|
||||
public function testReplaceHandler(): void
|
||||
{
|
||||
/** @var ResponseHandlerInterface */
|
||||
$handler = $this->getMockBuilder('Predis\Protocol\Text\Handler\ResponseHandlerInterface')->getMock();
|
||||
|
||||
$reader = new ResponseReader();
|
||||
@@ -50,7 +52,7 @@ class ResponseReaderTest extends PredisTestCase
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testReadResponse()
|
||||
public function testReadResponse(): void
|
||||
{
|
||||
$connection = $this->getMockConnectionOfType('Predis\Connection\CompositeConnectionInterface');
|
||||
$connection
|
||||
@@ -86,7 +88,7 @@ class ResponseReaderTest extends PredisTestCase
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testEmptyResponseHeader()
|
||||
public function testEmptyResponseHeader(): void
|
||||
{
|
||||
$this->expectException('Predis\Protocol\ProtocolException');
|
||||
$this->expectExceptionMessage('Unexpected empty reponse header [tcp://127.0.0.1:6379]');
|
||||
@@ -104,7 +106,7 @@ class ResponseReaderTest extends PredisTestCase
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testUnknownResponsePrefix()
|
||||
public function testUnknownResponsePrefix(): void
|
||||
{
|
||||
$this->expectException('Predis\Protocol\ProtocolException');
|
||||
$this->expectExceptionMessage("Unknown response prefix: '!' [tcp://127.0.0.1:6379]");
|
||||
|
||||
Reference in New Issue
Block a user