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

GraphicResolverFilePathTest::testInvoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
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