[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:
Daniele Alessandri
2020-08-28 18:59:10 +02:00
parent c2ede30394
commit 36c9bb047e
236 changed files with 2887 additions and 2454 deletions
@@ -21,9 +21,9 @@ class StreamableMultiBulkResponseTest extends PredisTestCase
/**
* @group disconnected
*/
public function testOk()
public function testOk(): void
{
$connection = $this->getMockBuilder('Predis\Connection\CompositeConnectionInterface')->getMock();
$connection = $this->getMockConnectionOfType('Predis\Connection\CompositeConnectionInterface');
$connection
->expects($this->never())
->method('readLine');
@@ -39,7 +39,7 @@ class StreamableMultiBulkResponseTest extends PredisTestCase
/**
* @group disconnected
*/
public function testInvalid()
public function testInvalid(): void
{
$this->expectException('Predis\Protocol\ProtocolException');
$this->expectExceptionMessage("Cannot parse 'invalid' as a valid length for a multi-bulk response [tcp://127.0.0.1:6379]");