Passed
Pull Request — master (#6)
by Siwapun
04:52
created

CallTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCallWithCurrying() 0 8 1
A testCallWithoutCurrying() 0 8 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\add;
5
use function Aerophant\Ramda\call;
6
use PHPUnit\Framework\TestCase;
7
8
class CallTest extends TestCase
9
{
10
  public function testCallWithCurrying()
11
  {
12
    $add = add();
13
    $firstArg = 1;
14
    $secondArg = 2;
15
    $expectedResult = 3;
16
    $actualResult = call()($add)($firstArg, $secondArg);
17
    $this->assertEquals($expectedResult, $actualResult);
18
  }
19
20
  public function testCallWithoutCurrying()
21
  {
22
    $add = add();
23
    $firstArg = 1;
24
    $secondArg = 2;
25
    $expectedResult = 3;
26
    $actualResult = call($add, $firstArg, $secondArg);
27
    $this->assertEquals($expectedResult, $actualResult);
28
  }
29
}
30