Completed
Push — master ( b21f54...1b4f53 )
by Siwapun
03:57
created

FirstTest::testFirstWithEmptyArray()   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\first;
5
use PHPUnit\Framework\TestCase;
6
7
class FirstTest extends TestCase
8
{
9
  public function testFirst()
10
  {
11
    $argument = [1, 2, 3, 4, 5];
12
    $expect = 1;
13
    $actual = first()($argument);
14
    $this->assertEquals($expect, $actual);
15
  }
16
17
  public function testFirstWithEmptyArray()
18
  {
19
    $argument = [];
20
    $actual = first()($argument);
21
    $this->assertNull($actual);
22
  }
23
}
24