Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function testSome() |
||
28 | { |
||
29 | $array = [1, 2, 3]; |
||
30 | |||
31 | $arrayHas2 = ArrayHelper::some($array, function (int $item) { |
||
32 | return $item === 2; |
||
33 | }); |
||
34 | $this->assertTrue($arrayHas2); |
||
35 | |||
36 | $arrayDoesNotHave4 = ArrayHelper::some($array, function (int $item) { |
||
37 | return $item === 4; |
||
38 | }); |
||
39 | $this->assertFalse($arrayDoesNotHave4); |
||
40 | } |
||
41 | |||
53 |