Completed
Pull Request — master (#2)
by Siwapun
13:33
created

DropTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testDropLast() 0 5 1
A testDropFirst() 0 5 1
A testDropNth() 0 5 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\drop;
5
use PHPUnit\Framework\TestCase;
6
7
class DropTest extends TestCase
8
{
9
10
  public function testDropFirst()
11
  {
12
    $array = [1, 3, 4, 5, 7];
13
    $result = drop(0)($array);
14
    $this->assertEquals([3, 4, 5, 7], $result);
15
  }
16
17
  public function testDropLast()
18
  {
19
    $array = [1, 3, 4, 5, 7];
20
    $result = drop(count($array) - 1)($array);
21
    $this->assertEquals([1, 3, 4, 5], $result);
22
  }
23
24
  public function testDropNth()
25
  {
26
    $array = [1, 3, 4, 5, 7];
27
    $result = drop(2)($array);
28
    $this->assertEquals([1, 3, 5, 7], $result);
29
  }
30
}
31