| @@ 63-95 (lines=33) @@ | ||
| 60 | $this->assertEquals('theValue', $config['loaders']['aLoader']['foo']['foo_option']); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function testAllowToUseLoaderFactorySeveralTimes() |
|
| 64 | { |
|
| 65 | $config = $this->processConfiguration( |
|
| 66 | new Configuration( |
|
| 67 | array( |
|
| 68 | new WebPathResolverFactory(), |
|
| 69 | ), |
|
| 70 | array( |
|
| 71 | new FooLoaderFactory(), |
|
| 72 | new FileSystemLoaderFactory(), |
|
| 73 | ) |
|
| 74 | ), |
|
| 75 | array(array( |
|
| 76 | 'loaders' => array( |
|
| 77 | 'aLoader' => array( |
|
| 78 | 'foo' => array( |
|
| 79 | 'foo_option' => 'theValue', |
|
| 80 | ), |
|
| 81 | ), |
|
| 82 | 'anotherLoader' => array( |
|
| 83 | 'foo' => array( |
|
| 84 | 'foo_option' => 'theValue', |
|
| 85 | ), |
|
| 86 | ), |
|
| 87 | ), |
|
| 88 | ||
| 89 | )) |
|
| 90 | ); |
|
| 91 | ||
| 92 | $this->assertArrayHasKey('loaders', $config); |
|
| 93 | $this->assertArrayHasKey('aLoader', $config['loaders']); |
|
| 94 | $this->assertArrayHasKey('anotherLoader', $config['loaders']); |
|
| 95 | } |
|
| 96 | ||
| 97 | public function testSetFilesystemLoaderAsDefaultLoaderIfNotDefined() |
|
| 98 | { |
|
| @@ 255-287 (lines=33) @@ | ||
| 252 | $this->assertEquals('theValue', $config['resolvers']['aResolver']['bar']['bar_option']); |
|
| 253 | } |
|
| 254 | ||
| 255 | public function testAllowToUseResolverFactorySeveralTimes() |
|
| 256 | { |
|
| 257 | $config = $this->processConfiguration( |
|
| 258 | new Configuration( |
|
| 259 | array( |
|
| 260 | new BarResolverFactory(), |
|
| 261 | new WebPathResolverFactory(), |
|
| 262 | ), |
|
| 263 | array( |
|
| 264 | new FileSystemLoaderFactory(), |
|
| 265 | ) |
|
| 266 | ), |
|
| 267 | array(array( |
|
| 268 | 'resolvers' => array( |
|
| 269 | 'aResolver' => array( |
|
| 270 | 'bar' => array( |
|
| 271 | 'bar_option' => 'theValue', |
|
| 272 | ), |
|
| 273 | ), |
|
| 274 | 'anotherResolver' => array( |
|
| 275 | 'bar' => array( |
|
| 276 | 'bar_option' => 'theValue', |
|
| 277 | ), |
|
| 278 | ), |
|
| 279 | ), |
|
| 280 | ||
| 281 | )) |
|
| 282 | ); |
|
| 283 | ||
| 284 | $this->assertArrayHasKey('resolvers', $config); |
|
| 285 | $this->assertArrayHasKey('aResolver', $config['resolvers']); |
|
| 286 | $this->assertArrayHasKey('anotherResolver', $config['resolvers']); |
|
| 287 | } |
|
| 288 | ||
| 289 | public function testSetWebPathAsDefaultResolverIfNotDefined() |
|
| 290 | { |
|