Completed
Push — master ( f7b33a...213343 )
by Andy
03:36
created

PalmtreeCanonicalUrlExtensionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetConfigurationParameter() 0 10 1
A testGetAlias() 0 10 1
1
<?php
2
3
namespace Palmtree\CanonicalUrlBundle\Tests\DependencyInjection;
4
5
use Palmtree\CanonicalUrlBundle\DependencyInjection\PalmtreeCanonicalUrlExtension;
6
use Palmtree\CanonicalUrlBundle\Tests\AbstractTest;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
class PalmtreeCanonicalUrlExtensionTest extends AbstractTest
10
{
11
    /**
12
     * @dataProvider configProvider
13
     */
14
    public function testSetConfigurationParameter(array $config)
15
    {
16
        $container = new ContainerBuilder();
17
        $container->setParameter('kernel.environment', 'test');
18
        $extension = new PalmtreeCanonicalUrlExtension();
19
20
        $extension->load(array($config), $container);
21
22
        $this->assertEquals($config, $container->getParameter('palmtree.canonical_url.config'));
23
    }
24
25
    public function testGetAlias()
26
    {
27
        $extension = new PalmtreeCanonicalUrlExtension();
28
29
        $this->assertEquals(
30
            'palmtree_canonical_url',
31
            $extension->getAlias(),
32
            'getAlias returns "palmtree_canonical_url"'
33
        );
34
    }
35
}
36