| @@ 32-61 (lines=30) @@ | ||
| 29 | new Configuration(array(), array()); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function testInjectLoaderFactoryConfig() |
|
| 33 | { |
|
| 34 | $config = $this->processConfiguration( |
|
| 35 | new Configuration( |
|
| 36 | array( |
|
| 37 | new WebPathResolverFactory(), |
|
| 38 | ), |
|
| 39 | array( |
|
| 40 | new FooLoaderFactory(), |
|
| 41 | new FileSystemLoaderFactory(), |
|
| 42 | ) |
|
| 43 | ), |
|
| 44 | array(array( |
|
| 45 | 'loaders' => array( |
|
| 46 | 'aLoader' => array( |
|
| 47 | 'foo' => array( |
|
| 48 | 'foo_option' => 'theValue', |
|
| 49 | ), |
|
| 50 | ), |
|
| 51 | ), |
|
| 52 | ||
| 53 | )) |
|
| 54 | ); |
|
| 55 | ||
| 56 | $this->assertArrayHasKey('loaders', $config); |
|
| 57 | $this->assertArrayHasKey('aLoader', $config['loaders']); |
|
| 58 | $this->assertArrayHasKey('foo', $config['loaders']['aLoader']); |
|
| 59 | $this->assertArrayHasKey('foo_option', $config['loaders']['aLoader']['foo']); |
|
| 60 | $this->assertEquals('theValue', $config['loaders']['aLoader']['foo']['foo_option']); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function testAllowToUseLoaderFactorySeveralTimes() |
|
| 64 | { |
|
| @@ 225-253 (lines=29) @@ | ||
| 222 | $this->assertArrayHasKey('foo', $config['loaders']['default']); |
|
| 223 | } |
|
| 224 | ||
| 225 | public function testInjectResolverFactoryConfig() |
|
| 226 | { |
|
| 227 | $config = $this->processConfiguration( |
|
| 228 | new Configuration( |
|
| 229 | array( |
|
| 230 | new BarResolverFactory(), |
|
| 231 | new WebPathResolverFactory(), |
|
| 232 | ), array( |
|
| 233 | new FileSystemLoaderFactory(), |
|
| 234 | ) |
|
| 235 | ), |
|
| 236 | array(array( |
|
| 237 | 'resolvers' => array( |
|
| 238 | 'aResolver' => array( |
|
| 239 | 'bar' => array( |
|
| 240 | 'bar_option' => 'theValue', |
|
| 241 | ), |
|
| 242 | ), |
|
| 243 | ), |
|
| 244 | ||
| 245 | )) |
|
| 246 | ); |
|
| 247 | ||
| 248 | $this->assertArrayHasKey('resolvers', $config); |
|
| 249 | $this->assertArrayHasKey('aResolver', $config['resolvers']); |
|
| 250 | $this->assertArrayHasKey('bar', $config['resolvers']['aResolver']); |
|
| 251 | $this->assertArrayHasKey('bar_option', $config['resolvers']['aResolver']['bar']); |
|
| 252 | $this->assertEquals('theValue', $config['resolvers']['aResolver']['bar']['bar_option']); |
|
| 253 | } |
|
| 254 | ||
| 255 | public function testAllowToUseResolverFactorySeveralTimes() |
|
| 256 | { |
|