Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class TransposeOnSpreadsheetTest extends AllSetupTeardown |
||
10 | { |
||
11 | #[DataProvider('providerTRANSPOSE')] |
||
12 | public function testTRANSPOSE(mixed $expectedResult, mixed $matrix): void |
||
13 | { |
||
14 | $sheet = $this->getSheet(); |
||
15 | $this->setArrayAsArray(); |
||
16 | if (!is_array($matrix)) { |
||
17 | $matrix = [$matrix]; |
||
18 | } |
||
19 | $sheet->fromArray($matrix, null, 'A1', true); |
||
20 | $highColumn = $sheet->getHighestDataColumn(); |
||
21 | $highRow = $sheet->getHighestDataRow(); |
||
22 | $newHighColumn = $highColumn; |
||
23 | ++$newHighColumn; |
||
24 | $sheet->getCell("{$newHighColumn}1") |
||
25 | ->setValue("=TRANSPOSE(A1:$highColumn$highRow)"); |
||
26 | self::assertSame($expectedResult, $sheet->getCell("{$newHighColumn}1")->getCalculatedValue()); |
||
27 | } |
||
28 | |||
29 | public static function providerTRANSPOSE(): array |
||
32 | } |
||
33 | } |
||
34 |