[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
@@ -27,23 +27,23 @@ class MultiBulkResponseTest extends PredisTestCase
$connection
->expects($this->once())
->method('getProtocol')
->willReturn(new CompositeProtocolProcessor());
->willReturn(
new CompositeProtocolProcessor()
);
$connection
->expects($this->at(1))
->expects($this->exactly(2))
->method('readLine')
->willReturn('$3');
->willReturnOnConsecutiveCalls(
'$3',
'$3'
);
$connection
->expects($this->at(2))
->expects($this->exactly(2))
->method('readBuffer')
->willReturn("foo\r\n");
$connection
->expects($this->at(3))
->method('readLine')
->willReturn('$3');
$connection
->expects($this->at(4))
->method('readBuffer')
->willReturn("bar\r\n");
->willReturnOnConsecutiveCalls(
"foo\r\n",
"bar\r\n"
);
$handler = new Handler\MultiBulkResponse();