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.
Completed
Pull Request — master (#34)
by
unknown
04:00 queued 02:11
created

ChainTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 31
rs 10
c 2
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoad() 0 12 1
A testGetExceptionWithNoFilter() 0 7 1
A testGetExceptionWithInvalidOptionsType() 0 7 1
1
<?php
2
3
namespace HtImgModuleTest\Imagine\Filter\Loader;
4
5
use HtImgModule\Imagine\Filter\Loader\Chain;
6
use Zend\ServiceManager\ServiceManager;
7
8
class ChainTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testLoad()
11
    {
12
        $filterLoaders = new ServiceManager;
13
        $filterLoader = $this->createMock('HtImgModule\Imagine\Filter\Loader\LoaderInterface');
14
        $filterLoader->expects($this->any())
15
            ->method('load')
16
            ->will($this->returnValue($this->createMock('Imagine\Filter\FilterInterface')));
17
        $filterLoaders->setService('thumbnail', $filterLoader);
18
        $chainLoader = new  Chain($filterLoaders);
19
        $chainFilter = $chainLoader->load(['filters' => ['thumbnail' => ['options' => []]]]);
20
        $this->assertInstanceOf('HtImgModule\Imagine\Filter\Chain', $chainFilter);
21
    }
22
23
    public function testGetExceptionWithNoFilter()
24
    {
25
        $filterLoaders = new ServiceManager;
26
        $chainLoader = new  Chain($filterLoaders);
27
        $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...
28
        $chainFilter = $chainLoader->load(['filters' => []]);
0 ignored issues
show
Unused Code introduced by
$chainFilter is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
29
    }
30
31
    public function testGetExceptionWithInvalidOptionsType()
32
    {
33
        $filterLoaders = new ServiceManager;
34
        $chainLoader = new  Chain($filterLoaders);
35
        $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...
36
        $chainFilter = $chainLoader->load(['filters' => '']);
0 ignored issues
show
Unused Code introduced by
$chainFilter is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
37
    }
38
}
39