Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

AdminPanelCompilerPassTest::registerCompilerPass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Tests\DependencyInjection\Compiler;
4
5
use Kunstmaan\AdminBundle\DependencyInjection\Compiler\AdminPanelCompilerPass;
6
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Definition;
9
use Symfony\Component\DependencyInjection\Reference;
10
11 View Code Duplication
class AdminPanelCompilerPassTest extends AbstractCompilerPassTestCase
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...
12
{
13
    protected function registerCompilerPass(ContainerBuilder $container)
14
    {
15
        $container->addCompilerPass(new AdminPanelCompilerPass());
16
    }
17
18
    public function testContainerKeys()
19
    {
20
        $svc = new Definition();
21
        $svc->addTag('kunstmaan_admin.admin_panel.adaptor');
22
        $this->setDefinition('kunstmaan_admin.admin_panel', $svc);
23
24
        $this->compile();
25
26
        $this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
27
            'kunstmaan_admin.admin_panel',
28
            'addAdminPanelAdaptor',
29
            [new Reference('kunstmaan_admin.admin_panel'), 0]
30
        );
31
    }
32
}
33