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

CallTest::testCallWithoutCurrying()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
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\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