Conditions | 7 |
Paths | 32 |
Total Lines | 24 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function testBASE($expectedResult, $arg1 = 'omitted', $arg2 = 'omitted', $arg3 = 'omitted'): void |
||
16 | { |
||
17 | $this->mightHaveException($expectedResult); |
||
18 | $sheet = $this->sheet; |
||
19 | if ($arg1 !== null) { |
||
20 | $sheet->getCell('A1')->setValue($arg1); |
||
21 | } |
||
22 | if ($arg2 !== null) { |
||
23 | $sheet->getCell('A2')->setValue($arg2); |
||
24 | } |
||
25 | if ($arg3 !== null) { |
||
26 | $sheet->getCell('A3')->setValue($arg3); |
||
27 | } |
||
28 | if ($arg1 === 'omitted') { |
||
29 | $sheet->getCell('B1')->setValue('=BASE()'); |
||
30 | } elseif ($arg2 === 'omitted') { |
||
31 | $sheet->getCell('B1')->setValue('=BASE(A1)'); |
||
32 | } elseif ($arg3 === 'omitted') { |
||
33 | $sheet->getCell('B1')->setValue('=BASE(A1, A2)'); |
||
34 | } else { |
||
35 | $sheet->getCell('B1')->setValue('=BASE(A1, A2, A3)'); |
||
36 | } |
||
37 | $result = $sheet->getCell('B1')->getCalculatedValue(); |
||
38 | self::assertEquals($expectedResult, $result); |
||
39 | } |
||
46 |