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

FiltersCompilerPassTest::testProcess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 21
Ratio 100 %

Importance

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