Conditions | 6 |
Paths | 24 |
Total Lines | 23 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function testSERIESSUM($expectedResult, $arg1, $arg2, $arg3, ...$args): void |
||
18 | { |
||
19 | $sheet = $this->sheet; |
||
20 | if ($arg1 !== null) { |
||
21 | $sheet->getCell('C1')->setValue($arg1); |
||
22 | } |
||
23 | if ($arg2 !== null) { |
||
24 | $sheet->getCell('C2')->setValue($arg2); |
||
25 | } |
||
26 | if ($arg3 !== null) { |
||
27 | $sheet->getCell('C3')->setValue($arg3); |
||
28 | } |
||
29 | $row = 0; |
||
30 | $aArgs = Functions::flattenArray($args); |
||
31 | foreach ($aArgs as $arg) { |
||
32 | ++$row; |
||
33 | if ($arg !== null) { |
||
34 | $sheet->getCell("A$row")->setValue($arg); |
||
35 | } |
||
36 | } |
||
37 | $sheet->getCell('B1')->setValue("=SERIESSUM(C1, C2, C3, A1:A$row)"); |
||
38 | $result = $sheet->getCell('B1')->getCalculatedValue(); |
||
39 | self::assertEqualsWithDelta($expectedResult, $result, 1E-12); |
||
40 | } |
||
47 |