Passed
Push — master ( 6bfa44...e0849e )
by Siwapun
06:09
created

DropTest::testDropLast()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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