Skip to content

Commit 3daac0a

Browse files
committed
Add TODO Note
ArrayFunctions2Test - the calculations seem too complicated for PhpSpreadsheet. The debug log is 21,300 lines, so I don't know how far I will get with it.
1 parent 6b5bf84 commit 3daac0a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/PhpSpreadsheetTests/Writer/Xlsx/ArrayFunctions2Test.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1616
use PHPUnit\Framework\TestCase;
1717

18+
// TODO - I think the spreadsheet below is too difficult for PhpSpreadsheet to calculate correctly.
19+
1820
class ArrayFunctions2Test extends TestCase
1921
{
2022
private const STYLESIZE14 = [
@@ -93,7 +95,8 @@ private function doPartijen(Worksheet $ws): int
9395

9496
$lijn = 1;
9597
for ($i = 1; $i <= $this->trn['RONDEN']; ++$i) {//aantal ronden oneven->heen en even->terug
96-
for ($j = 0; $j < count($saring); ++$j) {//subronden
98+
$countSaring = count($saring);
99+
for ($j = 0; $j < $countSaring; ++$j) {//subronden
97100
++$lijn;
98101
if (isset($KD[(($i - 1) * $this->trn['SUB_RONDEN']) + $j], $KD[(($i - 1) * $this->trn['SUB_RONDEN']) + $j]['RONDE'])) {
99102
$ws->setCellValue([9, $lijn], $KD[(($i - 1) * $this->trn['SUB_RONDEN']) + $j]['RONDE']);
@@ -109,7 +112,8 @@ private function doPartijen(Worksheet $ws): int
109112
$ws->getStyle('A' . $lijn . ':L' . $lijn . '')->applyFromArray(self::STYLEBOLD14);
110113

111114
$s2 = explode(' ', $saring[$j]);
112-
for ($k = 0; $k < count($s2); ++$k) {//borden
115+
$counts2 = count($s2);
116+
for ($k = 0; $k < $counts2; ++$k) {//borden
113117
if (trim($s2[$k]) == '') {
114118
continue;
115119
}
@@ -302,6 +306,7 @@ public function testManyArraysOutput(): void
302306
self::assertSame('Dirk', $wsPartijen->getCell('I3')->getCalculatedValue());
303307
self::assertSame('Rudy', $wsPartijen->getCell('K4')->getCalculatedValue());
304308
$calcArray = $wsSort2->getCell('A2')->getCalculatedValue();
309+
self::assertCount(8, $calcArray);
305310
$spreadsheet->disconnectWorksheets();
306311
}
307312
}

0 commit comments

Comments
 (0)