|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Class FindExtensionTest |
|
4
|
|
|
* |
|
5
|
|
|
* @author Mauro Moreno <[email protected]> |
|
6
|
|
|
*/ |
|
7
|
|
|
namespace MauroMoreno\FindBundle\Tests\Command; |
|
8
|
|
|
|
|
9
|
|
|
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; |
|
10
|
|
|
use MauroMoreno\FindBundle\DependencyInjection\FindExtension; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Class FindExtensionTest |
|
14
|
|
|
* @package MauroMoreno\FindBundle\Tests\Command |
|
15
|
|
|
*/ |
|
16
|
|
|
class FindExtensionTest extends AbstractExtensionTestCase |
|
17
|
|
|
{ |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Get container extension |
|
21
|
|
|
* @return array |
|
22
|
|
|
*/ |
|
23
|
|
|
protected function getContainerExtensions() |
|
24
|
|
|
{ |
|
25
|
|
|
return [new FindExtension]; |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Test find_directory_service not defined |
|
30
|
|
|
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException |
|
31
|
|
|
*/ |
|
32
|
|
|
public function testFindDirectoryServiceNotDefined() |
|
33
|
|
|
{ |
|
34
|
|
|
$this->load([]); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Test finder not defined |
|
39
|
|
|
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException |
|
40
|
|
|
*/ |
|
41
|
|
|
public function testFinderNotDefined() |
|
42
|
|
|
{ |
|
43
|
|
|
$this->load(['find_directory_service' => '']); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Test lister not defined |
|
48
|
|
|
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException |
|
49
|
|
|
*/ |
|
50
|
|
|
public function testListerNotDefined() |
|
51
|
|
|
{ |
|
52
|
|
|
$this->load(['find_directory_service' => '', 'finder' => '']); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Test Ok |
|
57
|
|
|
*/ |
|
58
|
|
|
public function testOk() |
|
59
|
|
|
{ |
|
60
|
|
|
$this->load( |
|
61
|
|
|
['find_directory_service' => '', 'finder' => '', 'lister' => ''] |
|
62
|
|
|
); |
|
63
|
|
|
|
|
64
|
|
|
$this->assertContainerBuilderHasParameter( |
|
65
|
|
|
'mauro_moreno_find.find_directory_service.class', |
|
66
|
|
|
'MauroMoreno\FindBundle\Service\FindDirectoryService' |
|
67
|
|
|
); |
|
68
|
|
|
$this->assertContainerBuilderHasParameter( |
|
69
|
|
|
'mauro_moreno_find.finder.class', |
|
70
|
|
|
'MauroMoreno\FindBundle\Service\Finder' |
|
71
|
|
|
); |
|
72
|
|
|
$this->assertContainerBuilderHasParameter( |
|
73
|
|
|
'mauro_moreno_find.lister.class', |
|
74
|
|
|
'MauroMoreno\FindBundle\Service\Lister' |
|
75
|
|
|
); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
} |