Completed
Push — master ( 74f423...06a480 )
by Siwapun
05:31 queued 03:49
created

RejectTest::testWithIsOdd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Aerophant\RamdaTest;
4
5
use function Aerophant\Ramda\reject;
6
use PHPUnit\Framework\TestCase;
7
8
class RejectTest extends TestCase
9
{
10
  public function testWithIsOdd()
11
  {
12
    $isOdd = function ($item) {
13
      return $item % 2 == 1;
14
    };
15
16
    $array = [1, 2, 3, 4];
17
    $expect = [2, 4];
18
    $actual = reject($isOdd)($array);
19
    $this->assertEquals($expect, $actual);
20
  }
21
}
22