Completed
Push — master ( af9165...d0edb0 )
by Sergei
01:22
created

ConfigurationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNoExplicitConfigProvided() 0 10 1
A testWithConfigGiven() 0 14 1
1
<?php
2
3
namespace Modera\BackendGoogleAnalyticsBundle\Tests\Unit\DependencyInjection;
4
5
use Modera\BackendGoogleAnalyticsBundle\DependencyInjection\Configuration;
6
use Symfony\Component\Config\Definition\Processor;
7
8
/**
9
 * @author  Alexander Ivanitsa <[email protected]>
10
 * @copyright 2017 Modera Foundation
11
 */
12
class ConfigurationTest extends \PHPUnit_Framework_TestCase
13
{
14
    public function testNoExplicitConfigProvided()
15
    {
16
        $configuration = new Configuration();
17
18
        $processor = new Processor();
19
        $config = $processor->processConfiguration($configuration, array());
20
21
        $this->assertArrayHasKey('enabled', $config);
22
        $this->assertTrue($config['enabled']);
23
    }
24
25
    public function testWithConfigGiven()
26
    {
27
        $configuration = new Configuration();
28
29
        $processor = new Processor();
30
        $config = $processor->processConfiguration($configuration, array(
31
            'modera_backend_google_analytics' => array(
32
                'enabled' => false,
33
            ),
34
        ));
35
36
        $this->assertArrayHasKey('enabled', $config);
37
        $this->assertFalse($config['enabled']);
38
    }
39
}
40