|
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
|
|
|
|