ConfigurationTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDefaultConfig() 0 15 1
1
<?php
2
3
/*
4
 * This file is part of the LoopBackApiBundle package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\LoopBackApiBundle\Tests\DependencyInjection;
13
14
use Fidry\LoopBackApiBundle\DependencyInjection\Configuration;
15
use Symfony\Component\Config\Definition\Processor;
16
17
/**
18
 * @coversDefaultClass Fidry\LoopBackApiBundle\DependencyInjection\Configuration
19
 *
20
 * @author Théo FIDRY <[email protected]>
21
 */
22
class ConfigurationTest extends \PHPUnit_Framework_TestCase
23
{
24
    private static $defaultConfig = [
25
        'parameters' => [
26
            'filter'        => 'filter',
27
            'search_filter' => 'where',
28
            'order_filter'  => 'order',
29
        ],
30
    ];
31
32
    /**
33
     * @cover ::getConfigTreeBuilder
34
     */
35
    public function testDefaultConfig()
36
    {
37
        $configuration = new Configuration();
38
        $treeBuilder = $configuration->getConfigTreeBuilder();
39
        $processor = new Processor();
40
        $config = $processor->processConfiguration(
41
            $configuration,
42
            [
43
                'loopback_api' => []
44
            ]
45
        );
46
        $this->assertInstanceOf('Symfony\Component\Config\Definition\ConfigurationInterface', $configuration);
47
        $this->assertInstanceOf('Symfony\Component\Config\Definition\Builder\TreeBuilder', $treeBuilder);
48
        $this->assertEquals(self::$defaultConfig, $config);
49
    }
50
}
51