| @@ 70-93 (lines=24) @@ | ||
| 67 | $this->processConfigTree($treeBuilder, array()); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testProcessCorrectlyOptionsOnAddConfiguration() |
|
| 71 | { |
|
| 72 | $expectedWrapper = 'theWrapper'; |
|
| 73 | $expectedContext = 'theContext'; |
|
| 74 | ||
| 75 | $treeBuilder = new TreeBuilder(); |
|
| 76 | $rootNode = $treeBuilder->root('stream', 'array'); |
|
| 77 | ||
| 78 | $loader = new StreamLoaderFactory(); |
|
| 79 | $loader->addConfiguration($rootNode); |
|
| 80 | ||
| 81 | $config = $this->processConfigTree($treeBuilder, array( |
|
| 82 | 'stream' => array( |
|
| 83 | 'wrapper' => $expectedWrapper, |
|
| 84 | 'context' => $expectedContext, |
|
| 85 | ), |
|
| 86 | )); |
|
| 87 | ||
| 88 | $this->assertArrayHasKey('wrapper', $config); |
|
| 89 | $this->assertEquals($expectedWrapper, $config['wrapper']); |
|
| 90 | ||
| 91 | $this->assertArrayHasKey('context', $config); |
|
| 92 | $this->assertEquals($expectedContext, $config['context']); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function testAddDefaultOptionsIfNotSetOnAddConfiguration() |
|
| 96 | { |
|
| @@ 55-78 (lines=24) @@ | ||
| 52 | $this->assertEquals('theCachePrefix', $resolverDefinition->getArgument(3)); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testProcessCorrectlyOptionsOnAddConfiguration() |
|
| 56 | { |
|
| 57 | $expectedWebPath = 'theWebPath'; |
|
| 58 | $expectedCachePrefix = 'theCachePrefix'; |
|
| 59 | ||
| 60 | $treeBuilder = new TreeBuilder(); |
|
| 61 | $rootNode = $treeBuilder->root('web_path', 'array'); |
|
| 62 | ||
| 63 | $resolver = new WebPathResolverFactory(); |
|
| 64 | $resolver->addConfiguration($rootNode); |
|
| 65 | ||
| 66 | $config = $this->processConfigTree($treeBuilder, array( |
|
| 67 | 'web_path' => array( |
|
| 68 | 'web_root' => $expectedWebPath, |
|
| 69 | 'cache_prefix' => $expectedCachePrefix, |
|
| 70 | ), |
|
| 71 | )); |
|
| 72 | ||
| 73 | $this->assertArrayHasKey('web_root', $config); |
|
| 74 | $this->assertEquals($expectedWebPath, $config['web_root']); |
|
| 75 | ||
| 76 | $this->assertArrayHasKey('cache_prefix', $config); |
|
| 77 | $this->assertEquals($expectedCachePrefix, $config['cache_prefix']); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testAddDefaultOptionsIfNotSetOnAddConfiguration() |
|
| 81 | { |
|