[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
+5 -6
View File
@@ -13,7 +13,7 @@ use Predis\Command\CommandInterface;
use SebastianBergmann\Exporter\Exporter;
/**
* Constraint that verifies a redis command.
* PHPUnit constraint to verify that a Redis command matches certain conditions.
*/
class RedisCommandConstraint extends \PHPUnit\Framework\Constraint\Constraint
{
@@ -21,10 +21,10 @@ class RedisCommandConstraint extends \PHPUnit\Framework\Constraint\Constraint
protected $arguments;
/**
* @param string|CommandInterface $command Expected command ID or instance.
* @param array $arguments Expected command arguments.
* @param string|CommandInterface $command Expected command instance or command ID
* @param ?array $arguments Expected command arguments
*/
public function __construct($command = null, array $arguments = null)
public function __construct($command, ?array $arguments = null)
{
if ($command instanceof CommandInterface) {
$this->commandID = strtoupper($command->getId());
@@ -68,8 +68,7 @@ class RedisCommandConstraint extends \PHPUnit\Framework\Constraint\Constraint
/**
* {@inheritdoc}
*
* @todo Improve output using diff when expected and actual arguments of a
* command do not match.
* @todo Improve output using diff when expected and actual do not match.
*/
public function toString(): string
{