ContainsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testArrayContainsItem() 0 6 1
A testArrayDoesNotContainItem() 0 6 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use PHPUnit\Framework\TestCase;
5
use function Aerophant\Ramda\contains;
6
7
class ContainsTest extends TestCase
8
{
9
  public function testArrayContainsItem()
10
  {
11
    $item = 1;
12
    $array = [1, 2, 3, 4, 5];
13
    $actual = contains($item)($array);
14
    $this->assertTrue($actual);
15
  }
16
17
  public function testArrayDoesNotContainItem()
18
  {
19
    $item = 1;
20
    $array = [2, 3, 4, 5];
21
    $actual = contains($item)($array);
22
    $this->assertFalse($actual);
23
  }
24
}
25