|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* AJGL CSV Bundle |
|
5
|
|
|
* |
|
6
|
|
|
* Copyright (C) Antonio J. García Lagar <[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 Ajgl\Bundle\Csv\Tests\DependencyInjection; |
|
13
|
|
|
|
|
14
|
|
|
use Ajgl\Bundle\CsvBundle\DependencyInjection\Configuration; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @author Antonio J. García Lagar <[email protected]> |
|
18
|
|
|
*/ |
|
19
|
|
|
class ConfigurationTest extends \PHPUnit_Framework_TestCase |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @var Configuration |
|
23
|
|
|
*/ |
|
24
|
|
|
private $configuration; |
|
25
|
|
|
|
|
26
|
|
|
protected function setUp() |
|
27
|
|
|
{ |
|
28
|
|
|
parent::setUp(); |
|
29
|
|
|
|
|
30
|
|
|
$this->configuration = new Configuration(); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function testDefaultConfiguration() |
|
34
|
|
|
{ |
|
35
|
|
|
$builder = $this->configuration->getConfigTreeBuilder(); |
|
36
|
|
|
$node = $builder->buildTree(); |
|
37
|
|
|
$this->assertInstanceOf('Symfony\Component\Config\Definition\ArrayNode', $node); |
|
38
|
|
|
$children = $node->getChildren(); |
|
39
|
|
|
|
|
40
|
|
|
$this->assertArrayHasKey('reader_default_type', $children); |
|
41
|
|
|
$this->assertInstanceOf('Symfony\Component\Config\Definition\EnumNode', $children['reader_default_type']); |
|
42
|
|
|
$this->assertSame(array('php', 'rfc'), $children['reader_default_type']->getValues()); |
|
43
|
|
|
$this->assertSame('php', $children['reader_default_type']->getDefaultValue()); |
|
44
|
|
|
|
|
45
|
|
|
$this->assertArrayHasKey('writer_default_type', $children); |
|
46
|
|
|
$this->assertInstanceOf('Symfony\Component\Config\Definition\EnumNode', $children['writer_default_type']); |
|
47
|
|
|
$this->assertSame(array('php', 'rfc'), $children['writer_default_type']->getValues()); |
|
48
|
|
|
$this->assertSame('php', $children['writer_default_type']->getDefaultValue()); |
|
49
|
|
|
} |
|
50
|
|
|
} |
|
51
|
|
|
|