Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function testIfElseOnFalseCondition() |
||
27 | { |
||
28 | $value = 10; |
||
29 | $isOdd = function ($it) { |
||
30 | return $it % 2 !== 0; |
||
31 | }; |
||
32 | $powerTwo = function ($it) { |
||
33 | return $it * $it; |
||
34 | }; |
||
35 | $powerThree = function ($it) { |
||
36 | return $it * $it * $it; |
||
37 | }; |
||
38 | $expect = 1000; |
||
39 | $actual = ifElse($isOdd)($powerTwo)($powerThree)($value); |
||
40 | $this->assertEquals($expect, $actual); |
||
41 | } |
||
43 |