ConfigurationTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testProcessedConfiguration() 0 8 1
B dataForProcessedConfiguration() 0 35 1
1
<?php
2
3
namespace Seblegall\ApiValidatorBundle\Tests\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Processor;
6
use Seblegall\ApiValidatorBundle\DependencyInjection\Configuration;
7
8
class ConfigurationTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @dataProvider dataForProcessedConfiguration
12
     */
13
    public function testProcessedConfiguration($configs, $expectedConfig)
14
    {
15
        $processor = new Processor();
16
        $configuration = new Configuration();
17
        $config = $processor->processConfiguration($configuration, $configs);
18
19
        $this->assertEquals($expectedConfig, $config);
20
    }
21
22
    public function dataForProcessedConfiguration()
23
    {
24
        return array(
25
            // dataset #0
26
            array(
27
                array(),
28
                array(
29
                    'content_type_listener' => array(
30
                        'decoders' => array(
31
                            'json' => 'api_validator.decoder.json',
32
                        ),
33
                    ),
34
                ),
35
            ),
36
            // dataset #1
37
            array(
38
                array(
39
                    'api_validator' => array(
40
                        'content_type_listener' => array(
41
                            'decoders' => array(
42
                                'json' => 'api_validator.decoder.json',
43
                            ),
44
                        ),
45
                    ),
46
                ),
47
                array(
48
                     'content_type_listener' => array(
49
                        'decoders' => array(
50
                            'json' => 'api_validator.decoder.json',
51
                        ),
52
                    ),
53
                ),
54
            ),
55
        );
56
    }
57
}
58