[tests] Replace deprecated TestCase::at().

The "at" matcher will be removed in PHPUnit 10 but it is not a bad thing
after all because it was cumbersome and error-prone.

Took the opportunity to improve some tests while converting them.
This commit is contained in:
Daniele Alessandri
2020-08-29 00:20:04 +02:00
parent c6f2ce4b83
commit 6d6c970ae2
16 changed files with 760 additions and 693 deletions
+6 -7
View File
@@ -304,15 +304,14 @@ class FactoryTest extends PredisTestCase
->method('getParameters')
->willReturn($parameters);
$connection
->expects($this->at(1))
->expects($this->exactly(2))
->method('addConnectCommand')
->with($this->isRedisCommand('AUTH', array('foobar')));
$connection
->expects($this->at(2))
->method('addConnectCommand')
->with($this->isRedisCommand('SELECT', array(0)));
->withConsecutive(
array($this->isRedisCommand('AUTH', array('foobar'))),
array($this->isRedisCommand('SELECT', array('0')))
);
$factory = new Factory();
$factory = new Factory();
// TODO: using reflection to make a protected method accessible :facepalm:
$reflection = new \ReflectionObject($factory);