Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function testIfElseOnTrueCondition() |
||
10 | { |
||
11 | $value = 10; |
||
12 | $isEven = function ($it) { |
||
13 | return $it % 2 === 0; |
||
14 | }; |
||
15 | $powerTwo = function ($it) { |
||
16 | return $it * $it; |
||
17 | }; |
||
18 | $powerThree = function ($it) { |
||
19 | return $it * $it * $it; |
||
20 | }; |
||
21 | $expect = 100; |
||
22 | $actual = ifElse($isEven)($powerTwo)($powerThree)($value); |
||
23 | $this->assertEquals($expect, $actual); |
||
24 | } |
||
43 |