ConfigurationTest::dataForProcessedConfiguration()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 35
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

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