Completed
Push — master ( 55a9c0...ed128c )
by Emil
14:56
created

ConfigurationTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A getConfigs() 0 6 1
A testUnConfiguredConfiguration() 0 5 1
1
<?php
2
3
namespace Glooby\TaskBundle\Tests\DependencyInjection;
4
5
use Glooby\TaskBundle\DependencyInjection\Configuration;
6
use Symfony\Component\Config\Definition\Processor;
7
8
/**
9
 * @author Emil Kilhage
10
 */
11
class ConfigurationTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * @var Processor
15
     */
16
    private $processor;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function setUp()
22
    {
23
        $this->processor = new Processor();
24
    }
25
26
    private function getConfigs(array $configArray)
27
    {
28
        $configuration = new Configuration(true);
0 ignored issues
show
Unused Code introduced by
The call to Configuration::__construct() has too many arguments starting with true.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
29
30
        return $this->processor->processConfiguration($configuration, array($configArray));
31
    }
32
33
    public function testUnConfiguredConfiguration()
34
    {
35
        $configuration = $this->getConfigs(array());
36
        $this->assertSame(array(), $configuration);
37
    }
38
}
39