Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | #[DataProvider('providerExpand')] |
||
14 | public function testExpand(mixed $expectedResult, string $formula): void |
||
15 | { |
||
16 | Calculation::setArrayReturnType( |
||
17 | Calculation::RETURN_ARRAY_AS_ARRAY |
||
18 | ); |
||
19 | $this->mightHaveException($expectedResult); |
||
20 | $sheet = $this->getSheet(); |
||
21 | $sheet->fromArray( |
||
22 | [ |
||
23 | ['a', 'b', 'c'], |
||
24 | ['d', 'e', 'f'], |
||
25 | ], |
||
26 | null, |
||
27 | 'B3', |
||
28 | true |
||
29 | ); |
||
30 | $this->getSpreadsheet()->addNamedRange( |
||
31 | new NamedRange( |
||
32 | 'definedname', |
||
33 | $sheet, |
||
34 | '$B$3:$D$11' |
||
35 | ) |
||
36 | ); |
||
37 | |||
38 | $sheet->setCellValue('F3', $formula); |
||
39 | $result = $sheet->getCell('F3')->getCalculatedValue(); |
||
40 | self::assertSame($expectedResult, $result); |
||
41 | } |
||
48 |