GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ImageRendererTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 6
dl 0
loc 37
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testRender() 0 15 1
A testGetExceptionWhenModelIsInvalid() 0 6 1
A testGetEngine() 0 5 1
A testSetResolver() 0 5 1
1
<?php
2
namespace HtImgModuleTest\View\Renderer;
3
4
use HtImgModule\View\Renderer\ImageRenderer;
5
use HtImgModule\View\Model\ImageModel;
6
use Zend\View\Model\ViewModel;
7
8
class ImageRendererTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testRender()
11
    {
12
        $imageOutputOptions = ['quality' => 93];
13
14
        $image = $this->createMock('Imagine\Image\ImageInterface');
15
        $image->expects($this->exactly(1))
16
            ->method('get', $imageOutputOptions)
0 ignored issues
show
Unused Code introduced by
The call to PHPUnit_Framework_MockOb...ocationMocker::method() has too many arguments starting with $imageOutputOptions.

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.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
            ->with('png')
18
            ->will($this->returnValue('image-binary-string'));
19
20
        $model = new ImageModel($image, 'png', $imageOutputOptions);
21
22
        $renderer = new ImageRenderer();
23
        $this->assertEquals('image-binary-string', $renderer->render($model));
24
    }
25
26
    public function testGetExceptionWhenModelIsInvalid()
27
    {
28
        $renderer = new ImageRenderer();
29
        $this->setExpectedException('HtImgModule\Exception\InvalidArgumentException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0; use expectException() instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
30
        $renderer->render(new ViewModel());
31
    }
32
33
    public function testGetEngine()
34
    {
35
        $renderer = new ImageRenderer();
36
        $this->assertEquals($renderer, $renderer->getEngine());
37
    }
38
39
    public function testSetResolver()
40
    {
41
        $renderer = new ImageRenderer();
42
        $this->assertEquals($renderer, $renderer->setResolver($this->createMock('Zend\View\Resolver\ResolverInterface')));
43
    }
44
}
45