Completed
Push — master ( 1f4ad9...320f5c )
by John
03:15
created

GraphicResolverFilePathTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvoke() 0 15 1
1
<?php
2
3
namespace Graze\CiffRenderer\Test\Unit\GraphicResolver;
4
5
use Mockery as m;
6
use Urbanplum\Bmp\Bmp;
7
use Graze\CiffRenderer\GraphicResolver\GraphicResolverFilePath;
8
9
class GraphicResolverFilePathTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testInvoke()
12
    {
13
        $filePath = '/path/to/font';
14
        $resourceExpected = 'resource';
15
        $bmp = m::mock(Bmp::class)
16
            ->shouldReceive('createFromFile')
0 ignored issues
show
Unused Code introduced by
The call to Mockery\MockInterface::shouldReceive() has too many arguments starting with 'createFromFile'. ( Ignorable by Annotation )

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

16
            ->/** @scrutinizer ignore-call */ shouldReceive('createFromFile')

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
17
            ->with($filePath)
18
            ->andReturn($resourceExpected)
19
            ->once()
20
            ->getMock();
21
22
        $graphicResolver = new GraphicResolverFilePath($bmp);
0 ignored issues
show
Bug introduced by
$bmp of type Mockery\MockInterface is incompatible with the type Urbanplum\Bmp\Bmp expected by parameter $bmp of Graze\CiffRenderer\Graph...FilePath::__construct(). ( Ignorable by Annotation )

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

22
        $graphicResolver = new GraphicResolverFilePath(/** @scrutinizer ignore-type */ $bmp);
Loading history...
23
        $resourceActual = $graphicResolver($filePath);
24
25
        $this->assertEquals($resourceExpected, $resourceActual);
26
    }
27
}
28