| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testHistoryRetrieval() |
||
| 12 | { |
||
| 13 | $it = new HistoryIterator(array(1, 2, 3, 4), 3); |
||
| 14 | |||
| 15 | $it->rewind(); |
||
| 16 | $it->valid(); |
||
| 17 | $this->assertEquals(1, $it->current()); |
||
| 18 | $this->assertFalse($it->hasPrev()); |
||
| 19 | |||
| 20 | $it->next(); |
||
| 21 | $this->assertTrue($it->valid()); |
||
| 22 | $this->assertTrue($it->valid()); |
||
| 23 | $this->assertEquals(2, $it->current()); |
||
| 24 | $this->assertEquals(1, $it->prev(1)); |
||
| 25 | $this->assertTrue($it->hasPrev()); |
||
| 26 | |||
| 27 | $it->next(); |
||
| 28 | $this->assertTrue($it->valid()); |
||
| 29 | $this->assertEquals(3, $it->current()); |
||
| 30 | $this->assertEquals(2, $it->prev(1)); |
||
| 31 | $this->assertEquals(1, $it->prev(2)); |
||
| 32 | } |
||
| 33 | |||
| 42 |