mirror of
https://github.com/predis/predis.git
synced 2026-10-09 05:16:32 +00:00
iterate not iterable connections #552
This commit is contained in:
committed by
Peter Gribanov
parent
111d100ee3
commit
4363345f7c
@@ -853,15 +853,17 @@ class ClientTest extends PredisTestCase
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
* @expectedException \Predis\ClientException
|
||||
* @expectedExceptionMessage The underlying connection is not traversable
|
||||
*/
|
||||
public function testGetIteratorWithNonTraversableConnectionThrowsException()
|
||||
public function testGetIteratorWithNonTraversableConnectionNoException()
|
||||
{
|
||||
$connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
|
||||
$connection = $this->getMockConnection('tcp://127.0.0.1:6381');
|
||||
$client = new Client($connection);
|
||||
|
||||
$client->getIterator();
|
||||
$iterator = $client->getIterator();
|
||||
|
||||
$this->assertInstanceOf('\Predis\Client', $nodeClient = $iterator->current());
|
||||
$this->assertSame($connection, $nodeClient->getConnection());
|
||||
$this->assertSame('127.0.0.1:6381', $iterator->key());
|
||||
}
|
||||
|
||||
// ******************************************************************** //
|
||||
|
||||
Reference in New Issue
Block a user