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

RangeTest::testRangeWithInteger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Aerophant\RamdaTest;
4
5
use PHPUnit\Framework\TestCase;
6
use function Aerophant\Ramda\range;
7
8
class RangeTest extends TestCase
9
{
10
  public function testRangeWithInteger()
11
  {
12
    $from = 1;
13
    $to = 5;
14
    $expect = [1, 2, 3, 4, 5];
15
    $actual = range($from)($to);
16
    $this->assertEquals($expect, $actual);
17
  }
18
19
  public function testRangeWithFloat()
20
  {
21
    $from = 0.1;
22
    $to = 5;
23
    $expect = [0.1, 1.1, 2.1, 3.1, 4.1];
24
    $actual = range($from)($to);
25
    $this->assertEquals($expect, $actual);
26
  }
27
}
28