| @@ 73-89 (lines=17) @@ | ||
| 70 | $this->assertEquals($expectedDataRoot, $config['data_root']); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function testAddDefaultOptionsIfNotSetOnAddConfiguration() |
|
| 74 | { |
|
| 75 | $expectedDataRoot = '%kernel.root_dir%/../web'; |
|
| 76 | ||
| 77 | $treeBuilder = new TreeBuilder(); |
|
| 78 | $rootNode = $treeBuilder->root('filesystem', 'array'); |
|
| 79 | ||
| 80 | $loader = new FileSystemLoaderFactory(); |
|
| 81 | $loader->addConfiguration($rootNode); |
|
| 82 | ||
| 83 | $config = $this->processConfigTree($treeBuilder, array( |
|
| 84 | 'filesystem' => array(), |
|
| 85 | )); |
|
| 86 | ||
| 87 | $this->assertArrayHasKey('data_root', $config); |
|
| 88 | $this->assertEquals($expectedDataRoot, $config['data_root']); |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * @param TreeBuilder $treeBuilder |
|
| @@ 95-111 (lines=17) @@ | ||
| 92 | $this->assertEquals($expectedContext, $config['context']); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function testAddDefaultOptionsIfNotSetOnAddConfiguration() |
|
| 96 | { |
|
| 97 | $treeBuilder = new TreeBuilder(); |
|
| 98 | $rootNode = $treeBuilder->root('stream', 'array'); |
|
| 99 | ||
| 100 | $loader = new StreamLoaderFactory(); |
|
| 101 | $loader->addConfiguration($rootNode); |
|
| 102 | ||
| 103 | $config = $this->processConfigTree($treeBuilder, array( |
|
| 104 | 'stream' => array( |
|
| 105 | 'wrapper' => 'aWrapper', |
|
| 106 | ), |
|
| 107 | )); |
|
| 108 | ||
| 109 | $this->assertArrayHasKey('context', $config); |
|
| 110 | $this->assertNull($config['context']); |
|
| 111 | } |
|
| 112 | ||
| 113 | /** |
|
| 114 | * @param TreeBuilder $treeBuilder |
|
| @@ 81-99 (lines=19) @@ | ||
| 78 | $this->processConfigTree($treeBuilder, array()); |
|
| 79 | } |
|
| 80 | ||
| 81 | public function testProcessCorrectlyOptionsOnAddConfiguration() |
|
| 82 | { |
|
| 83 | $expectedService = 'theService'; |
|
| 84 | ||
| 85 | $treeBuilder = new TreeBuilder(); |
|
| 86 | $rootNode = $treeBuilder->root('flysystem', 'array'); |
|
| 87 | ||
| 88 | $loader = new FlysystemLoaderFactory(); |
|
| 89 | $loader->addConfiguration($rootNode); |
|
| 90 | ||
| 91 | $config = $this->processConfigTree($treeBuilder, array( |
|
| 92 | 'flysystem' => array( |
|
| 93 | 'filesystem_service' => $expectedService, |
|
| 94 | ), |
|
| 95 | )); |
|
| 96 | ||
| 97 | $this->assertArrayHasKey('filesystem_service', $config); |
|
| 98 | $this->assertEquals($expectedService, $config['filesystem_service']); |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * @param TreeBuilder $treeBuilder |
|