Passed
Push — master ( 9280cd...76fe10 )
by Simon
02:08
created

ReportPatternCompilerTest::reportPatternTest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 12

Duplication

Lines 20
Ratio 100 %

Importance

Changes 0
Metric Value
dl 20
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of
5
 * 
6
 * (c) symball <http://simonball.me>
7
 * 
8
 * For the full copyright and license information, please view the LICENSE file 
9
 * that was distributed with this source code.
10
 */
11
12
namespace Symball\ReportBundle\Tests\Extension;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Definition;
16
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
17
use Symball\ReportBundle\DependencyInjection\Compiler\ReportPatternPass;
18
/**
19
 * Description of CompilerTest
20
 *
21
 * @author Simon Ball <simonball at simonball dot me>
22
 */
23 View Code Duplication
class ReportPatternCompilerTest 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...
24
{
25
    protected function registerCompilerPass(ContainerBuilder $container)
26
    {
27
        $container->addCompilerPass(new ReportPatternPass());
28
    }
29
    
30
    public function reportPatternTest()
31
    {
32
        $collectingService = new Definition();
33
        $this->setDefinition('symball_report.pattern', $collectingService);
34
        
35
        $collectedService = new Definition();
36
        $collectedService->addTag('symball_report.pattern', ['alias' => 'test_alias']);
37
        $this->setDefinition('some_unimportant_service_id', $collectedService);
38
        
39
        $this->compile();
40
        
41
        $this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
42
            'symball_report.pattern',
43
            'add',
44
            array(
45
                new Reference('some_unimportant_service_id')
46
            )
47
        );
48
        
49
    }
50
}