PalmtreeCanonicalUrlBundleTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetContainerExtension() 0 7 1
A testCompilerPass() 0 19 3
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