Completed
Pull Request — master (#18)
by John
05:06 queued 03:09
created

GraphicResolverFilePathTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvoke() 0 16 1
1
<?php
2
3
namespace Graze\CiffRenderer\Test\Unit\Renderer\GraphicResolver;
4
5
use Mockery as m;
6
use Urbanplum\Bmp\Bmp;
7
use Graze\CiffRenderer\Renderer\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('create')
17
            ->with($filePath)
18
            ->andReturn($resourceExpected)
19
            ->once()
20
            ->getMock();
21
22
        $graphicResolver = new GraphicResolverFilePath($bmp);
23
        $resourceActual = $graphicResolver($filePath);
24
25
        $this->assertEquals($resourceExpected, $resourceActual);
26
    }
27
}
28