| 1 | <?php |
||
| 11 | class TwigRuntimePassTest extends AbstractCompilerPassTestCase |
||
| 12 | { |
||
| 13 | protected function registerCompilerPass(ContainerBuilder $container) |
||
| 14 | { |
||
| 15 | $container->addCompilerPass(new TwigRuntimePass()); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function testCompilerPassCollectsValidServices() |
||
| 19 | { |
||
| 20 | $twig = new Definition(); |
||
| 21 | $this->setDefinition('twig', $twig); |
||
| 22 | |||
| 23 | $this->compile(); |
||
| 24 | |||
| 25 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
||
| 26 | 'twig', |
||
| 27 | 'addRuntimeLoader', |
||
| 28 | array( |
||
| 29 | new Reference('netgen_open_graph.templating.twig.runtime.loader'), |
||
| 30 | ) |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function testCompilerPassWithTwigRuntimeLoaderService() |
||
| 35 | { |
||
| 36 | $twig = new Definition(); |
||
| 37 | $this->setDefinition('twig.runtime_loader', $twig); |
||
| 38 | |||
| 39 | $this->compile(); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |