Cell indexes not being respected when rendering row

Fixes #682
When calling `Row::setCellIndex`, it's possible to create a Row with holes.
Instead of iterating over existing cells of a Row, we should instead use the cell indexes (from 0 to max cell index).
This commit is contained in:
Adrien Loison committed 2019-09-28 15:42:19 +02:00
1 parent 2d297e954b
commit ea1dfa22e9
6 files changed
+65 -41

No files matched your search

@@ -12,7 +12,7 @@ class CellHelperTest extends TestCase
/**
* @return array
*/
public function dataProviderForTestGetCellIndexFromColumnIndex()
public function dataProviderForTestGetColumnLettersFromColumnIndex()
{
return [
[0, 'A'],
@@ -24,14 +24,15 @@ class CellHelperTest extends TestCase
}
/**
* @dataProvider dataProviderForTestGetCellIndexFromColumnIndex
* @dataProvider dataProviderForTestGetColumnLettersFromColumnIndex
*
* @param int $columnIndex
* @param string $expectedColumnLetters
*
* @param int $columnIndex
* @param string $expectedCellIndex
* @return void
*/
public function testGetCellIndexFromColumnIndex($columnIndex, $expectedCellIndex)
public function testGetColumnLettersFromColumnIndex($columnIndex, $expectedColumnLetters)
{
$this->assertEquals($expectedCellIndex, CellHelper::getCellIndexFromColumnIndex($columnIndex));
$this->assertEquals($expectedColumnLetters, CellHelper::getColumnLettersFromColumnIndex($columnIndex));
}
}