ConfigurationTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfiguration() 0 4 1
A testFindDirectoryServiceNotDefined() 0 9 1
A testFinderNotDefined() 0 9 1
A testListerNotDefined() 0 10 1
A testOk() 0 10 1
1
<?php
2
/**
3
 * Class ConfigurationTest
4
 *
5
 * @author Mauro Moreno <[email protected]>
6
 */
7
namespace MauroMoreno\FindBundle\Tests\Command;
8
9
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
10
use MauroMoreno\FindBundle\DependencyInjection\Configuration;
11
use Symfony\Component\Config\Definition\ConfigurationInterface;
12
13
/**
14
 * Class ConfigurationTest
15
 * @package MauroMoreno\FindBundle\Tests\Command
16
 */
17
class ConfigurationTest extends \PHPUnit_Framework_TestCase
18
{
19
20
    /**
21
     * Use Trait for Configuration testing
22
     */
23
    use ConfigurationTestCaseTrait;
24
25
    /**
26
     * @return ConfigurationInterface
27
     */
28
    protected function getConfiguration()
29
    {
30
        return new Configuration();
31
    }
32
33
    /**
34
     * Test find_directory_service not defined
35
     */
36
    public function testFindDirectoryServiceNotDefined()
37
    {
38
        $this->assertConfigurationIsInvalid(
39
            [
40
                []
41
            ],
42
            'find_directory_service'
43
        );
44
    }
45
46
    /**
47
     * Test finder not defined
48
     */
49
    public function testFinderNotDefined()
50
    {
51
        $this->assertConfigurationIsInvalid(
52
            [
53
                ['find_directory_service' => '']
54
            ],
55
            'finder'
56
        );
57
    }
58
59
    /**
60
     * Test lister not defined
61
     */
62
    public function testListerNotDefined()
63
    {
64
        $this->assertConfigurationIsInvalid(
65
            [
66
                ['find_directory_service' => ''],
67
                ['finder' => '']
68
            ],
69
            'lister'
70
        );
71
    }
72
73
    /**
74
     * Test Ok
75
     */
76
    public function testOk()
77
    {
78
        $this->assertConfigurationIsValid(
79
            [
80
                ['find_directory_service' => ''],
81
                ['finder' => ''],
82
                ['lister' => ''],
83
            ]
84
        );
85
    }
86
87
}
88