Completed
Push — master ( 7558dc...7b996e )
by Andy
02:16
created

testGetContainerExtension()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Palmtree\CanonicalUrlBundle\Tests;
4
5
use Palmtree\CanonicalUrlBundle\DependencyInjection\Compiler\CompilerPass;
6
use Palmtree\CanonicalUrlBundle\DependencyInjection\PalmtreeCanonicalUrlExtension;
7
use Palmtree\CanonicalUrlBundle\PalmtreeCanonicalUrlBundle;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
class PalmtreeCanonicalUrlBundleTest extends TestCase
12
{
13
    public function testGetContainerExtension()
14
    {
15
        $bundle = new PalmtreeCanonicalUrlBundle();
16
17
        $this->assertInstanceOf(
18
            PalmtreeCanonicalUrlExtension::class,
19
            $bundle->getContainerExtension()
20
        );
21
    }
22
23
    public function testCompilerPass()
24
    {
25
        $bundle = new PalmtreeCanonicalUrlBundle();
26
27
        $container = new ContainerBuilder();
28
29
        $bundle->build($container);
30
31
        $passes = $container->getCompilerPassConfig()->getPasses();
32
        $found  = false;
33
34
        foreach ($passes as $pass) {
35
            if ($pass instanceof CompilerPass) {
36
                $found = true;
37
                break;
38
            }
39
        }
40
41
        $this->assertTrue($found);
42
    }
43
}
44