mirror of
https://github.com/predis/predis.git
synced 2026-10-13 07:18:10 +00:00
[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:
@@ -57,25 +57,15 @@ class ProtocolProcessorTest extends PredisTestCase
|
||||
|
||||
$connection = $this->getMockConnectionOfType('Predis\Connection\CompositeConnectionInterface');
|
||||
$connection
|
||||
->expects($this->at(0))
|
||||
->expects($this->exactly(5))
|
||||
->method('readLine')
|
||||
->willReturn('+OK');
|
||||
$connection
|
||||
->expects($this->at(1))
|
||||
->method('readLine')
|
||||
->willReturn('-ERR error message');
|
||||
$connection
|
||||
->expects($this->at(2))
|
||||
->method('readLine')
|
||||
->willReturn(':2');
|
||||
$connection
|
||||
->expects($this->at(3))
|
||||
->method('readLine')
|
||||
->willReturn('$-1');
|
||||
$connection
|
||||
->expects($this->at(4))
|
||||
->method('readLine')
|
||||
->willReturn('*-1');
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'+OK',
|
||||
'-ERR error message',
|
||||
':2',
|
||||
'$-1',
|
||||
'*-1'
|
||||
);
|
||||
|
||||
$this->assertEquals('OK', $protocol->read($connection));
|
||||
$this->assertEquals('ERR error message', $protocol->read($connection));
|
||||
|
||||
Reference in New Issue
Block a user