Completed
Pull Request — master (#5)
by Siwapun
02:42
created

PartialTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testPartial() 0 7 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\multiply;
5
use function Aerophant\Ramda\partial;
6
use PHPUnit\Framework\TestCase;
7
8
class PartialTest extends TestCase
9
{
10
  public function testPartial()
11
  {
12
    $double = partial(multiply(), [2]);
0 ignored issues
show
Bug introduced by
It seems like multiply() can also be of type integer and double; however, parameter $fn of Aerophant\Ramda\partial() does only seem to accept callable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

12
    $double = partial(/** @scrutinizer ignore-type */ multiply(), [2]);
Loading history...
13
    $arg = 10;
14
    $expectedResult = 20;
15
    $actualResult = $double($arg);
16
    $this->assertEquals($expectedResult, $actualResult);
17
  }
18
}
19