Completed
Push — master ( 618a28...d2b433 )
by Christophe
02:18
created

RenderSubscriberCompilerPassTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testProcessSuccessful() 0 11 1
1
<?php
2
3
namespace Chris\Bundle\FrontRenderBundle\Tests\CompilerPass;
4
5
use Chris\Bundle\FrontRenderBundle\DependencyInjection\CompilerPass\RenderSubscriberCompilerPass;
6
use Chris\Bundle\FrontRenderBundle\Subscriber\RenderSubscriber;
7
use PHPUnit_Framework_TestCase;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
10
class RenderSubscriberCompilerPassTest extends PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @var ContainerBuilder
14
     */
15
    protected $containerBuilder;
16
17
    /**
18
     * @var RenderSubscriberCompilerPass
19
     */
20
    protected $compilerPass;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function setUp()
26
    {
27
        $this->containerBuilder = new ContainerBuilder();
28
        $this->compilerPass     = new RenderSubscriberCompilerPass();
29
    }
30
31
    /**
32
     * Test the success on the compiler pass
33
     */
34
    public function testProcessSuccessful()
35
    {
36
        $this->containerBuilder->setParameter('templating.engines', ['php']);
37
38
        $this->containerBuilder
39
            ->register('front_render_bundle.render_subscriber', RenderSubscriber::class);
40
41
        $this->compilerPass->process($this->containerBuilder);
42
43
        $this->assertFalse($this->containerBuilder->hasDefinition('front_render_bundle.render_subscriber'));
44
    }
45
}
46