mirror of
https://github.com/predis/predis.git
synced 2026-08-30 20:21:31 +00:00
The \Iterator interface returns void for next().
This commit is contained in:
@@ -65,8 +65,6 @@ abstract class MultiBulkIterator implements Iterator, Countable, ResponseInterfa
|
||||
if (++$this->position < $this->size) {
|
||||
$this->current = $this->getValue();
|
||||
}
|
||||
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,19 +31,19 @@ class MultiBulkTest extends PredisTestCase
|
||||
|
||||
$this->assertInstanceOf('Iterator', $iterator = $client->lrange('metavars', 0, -1));
|
||||
$this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $iterator);
|
||||
$this->assertTrue($iterator->valid());
|
||||
$iterator->valid();
|
||||
$this->assertSame(3, $iterator->count());
|
||||
|
||||
$this->assertSame('foo', $iterator->current());
|
||||
$this->assertSame(1, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertTrue($iterator->valid());
|
||||
|
||||
$this->assertSame('hoge', $iterator->current());
|
||||
$this->assertSame(2, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertTrue($iterator->valid());
|
||||
|
||||
$this->assertSame('lol', $iterator->current());
|
||||
$this->assertSame(3, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertFalse($iterator->valid());
|
||||
|
||||
$this->assertEquals('PONG', $client->ping());
|
||||
|
||||
@@ -65,15 +65,15 @@ class MultiBulkTupleTest extends PredisTestCase
|
||||
$this->assertSame(3, $iterator->count());
|
||||
|
||||
$this->assertSame(array('foo', '1'), $iterator->current());
|
||||
$this->assertSame(1, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertTrue($iterator->valid());
|
||||
|
||||
$this->assertSame(array('hoge', '2'), $iterator->current());
|
||||
$this->assertSame(2, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertTrue($iterator->valid());
|
||||
|
||||
$this->assertSame(array('lol', '3'), $iterator->current());
|
||||
$this->assertSame(3, $iterator->next());
|
||||
$iterator->next();
|
||||
$this->assertFalse($iterator->valid());
|
||||
|
||||
$this->assertEquals('PONG', $client->ping());
|
||||
|
||||
Reference in New Issue
Block a user