You are here

public function ColumnIteratorTest::testIteratorSeekAndPrev in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Worksheet/ColumnIteratorTest.php \ColumnIteratorTest::testIteratorSeekAndPrev()

File

vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Worksheet/ColumnIteratorTest.php, line 56

Class

ColumnIteratorTest

Code

public function testIteratorSeekAndPrev() {
  $ranges = range('A', 'E');
  $iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
  $columnIndexResult = 'D';
  $iterator
    ->seek('D');
  $this
    ->assertEquals($columnIndexResult, $iterator
    ->key());
  for ($i = 1; $i < array_search($columnIndexResult, $ranges); $i++) {
    $iterator
      ->prev();
    $expectedResult = $ranges[array_search($columnIndexResult, $ranges) - $i];
    $this
      ->assertEquals($expectedResult, $iterator
      ->key());
  }
}