Conditions | 1 |
Paths | 1 |
Total Lines | 35 |
Code Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | #[DataProvider('providerChooseRows')] |
||
14 | public function testChooseRows(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 | ['g', 'h', 'i'], |
||
26 | ['j', 'k', 'l'], |
||
27 | ['m', 'n', 'o'], |
||
28 | ['p', 'q', 'r'], |
||
29 | ['s', 't', 'u'], |
||
30 | ['v', 'w', 'x'], |
||
31 | ['y', 'z', '#'], |
||
32 | ], |
||
33 | null, |
||
34 | 'B3', |
||
35 | true |
||
36 | ); |
||
37 | $this->getSpreadsheet()->addNamedRange( |
||
38 | new NamedRange( |
||
39 | 'definedname', |
||
40 | $sheet, |
||
41 | '$B$3:$D$11' |
||
42 | ) |
||
43 | ); |
||
44 | |||
45 | $sheet->setCellValue('F3', $formula); |
||
46 | $result = $sheet->getCell('F3')->getCalculatedValue(); |
||
47 | self::assertSame($expectedResult, $result); |
||
48 | } |
||
55 |