public function RowCellIteratorTest::testIteratorSeekAndPrev in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Worksheet/RowCellIteratorTest.php \RowCellIteratorTest::testIteratorSeekAndPrev()
File
- vendor/
phpoffice/ phpexcel/ unitTests/ Classes/ PHPExcel/ Worksheet/ RowCellIteratorTest.php, line 56
Class
Code
public function testIteratorSeekAndPrev() {
$ranges = range('A', 'E');
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$RowCellIndexResult = 'D';
$iterator
->seek('D');
$this
->assertEquals($RowCellIndexResult, $iterator
->key());
for ($i = 1; $i < array_search($RowCellIndexResult, $ranges); $i++) {
$iterator
->prev();
$expectedResult = $ranges[array_search($RowCellIndexResult, $ranges) - $i];
$this
->assertEquals($expectedResult, $iterator
->key());
}
}