1 | <?php |
||
11 | class CustomFieldHandlersPassTest extends AbstractCompilerPassTestCase |
||
12 | { |
||
13 | public function testCompilerPassCollectsValidServices() |
||
14 | { |
||
15 | $registry = new Definition(); |
||
16 | $this->setDefinition(CustomFieldHandlersPass::FIELD_HANDLER_REGISTRY, $registry); |
||
17 | |||
18 | $fieldHandler = new Definition(); |
||
19 | $fieldHandler->addTag(CustomFieldHandlersPass::FIELD_HANDLER); |
||
20 | $this->setDefinition('custom_handler', $fieldHandler); |
||
21 | |||
22 | $this->compile(); |
||
23 | |||
24 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
||
25 | CustomFieldHandlersPass::FIELD_HANDLER_REGISTRY, |
||
26 | 'addHandler', |
||
27 | array( |
||
28 | new Reference('custom_handler'), |
||
29 | ) |
||
30 | ); |
||
31 | } |
||
32 | |||
33 | protected function registerCompilerPass(ContainerBuilder $container) |
||
34 | { |
||
35 | $container->addCompilerPass(new CustomFieldHandlersPass()); |
||
36 | } |
||
37 | } |
||
38 |