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:
1 parent
2d297e954b
commit
16a2f91a22
6 files changed
+65
-41
No files matched your search
@@ -78,10 +78,24 @@ class RowTest extends \PHPUnit\Framework\TestCase
|
||||
$row = new Row([], null);
|
||||
$cellMock = $this->getCellMock();
|
||||
$row->setCellAtIndex($cellMock, 3);
|
||||
|
||||
$this->assertEquals($cellMock, $row->getCellAtIndex(3));
|
||||
$this->assertNull($row->getCellAtIndex(10));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testSetCellAtIndex()
|
||||
{
|
||||
$row = new Row([], null);
|
||||
$cellMock = $this->getCellMock();
|
||||
$row->setCellAtIndex($cellMock, 1);
|
||||
|
||||
$this->assertEquals(2, $row->getNumCells());
|
||||
$this->assertNull($row->getCellAtIndex(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user