Passed
Push — master ( e9156b...0f4b8d )
by Sérgio
03:22
created

ApplyTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldReturnAClosure() 0 4 1
A shouldReturnANumber() 0 4 1
1
<?php
2
3
namespace Sergiors\Functional\Tests;
4
5
use function Prelude\apply;
6
7
class ApplyTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @test
11
     */
12
    public function shouldReturnAClosure()
13
    {
14
        $this->assertInstanceOf(\Closure::class, apply('max'));
15
    }
16
17
    /**
18
     * @test
19
     */
20
    public function shouldReturnANumber()
21
    {
22
        $this->assertEquals(42, apply('max', [1, 2, 3, -99, 42, 6, 7]));
23
    }
24
}
25