testProcessSuccessful()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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