Completed
Pull Request — master (#732)
by 12345
03:41
created

FiltersCompilerPassTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 24
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProcess() 21 21 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Liip\ImagineBundle\Tests\DependencyInjection\Compiler;
4
5
use Liip\ImagineBundle\DependencyInjection\Compiler\FiltersCompilerPass;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Definition;
8
9
/**
10
 * @covers Liip\ImagineBundle\DependencyInjection\Compiler\FiltersCompilerPass
11
 */
12 View Code Duplication
class FiltersCompilerPassTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    public function testProcess()
15
    {
16
        $managerDefinition = new Definition();
17
        $loaderDefinition = new Definition();
18
        $loaderDefinition->addTag('liip_imagine.filter.loader', array(
19
            'loader' => 'foo',
20
        ));
21
22
        $container = new ContainerBuilder();
23
        $container->setDefinition('liip_imagine.filter.manager', $managerDefinition);
24
        $container->setDefinition('a.loader', $loaderDefinition);
25
26
        $pass = new FiltersCompilerPass();
27
28
        //guard
29
        $this->assertCount(0, $managerDefinition->getMethodCalls());
30
31
        $pass->process($container);
32
33
        $this->assertCount(1, $managerDefinition->getMethodCalls());
34
    }
35
}
36