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

ConfigurationTest::testNoExplicitConfigProvided()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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