| @@ 16-36 (lines=21) @@ | ||
| 13 | */ |
|
| 14 | class AdditionalReporterCompilerPassTest extends AbstractCompilerPassTestCase |
|
| 15 | { |
|
| 16 | public function testProcessWithAlias() |
|
| 17 | { |
|
| 18 | $runner = new Definition(); |
|
| 19 | $this->setDefinition('liip_monitor.runner_default', $runner); |
|
| 20 | $this->setParameter('liip_monitor.runners', ['liip_monitor.runner_default']); |
|
| 21 | ||
| 22 | $reporter = new Definition(); |
|
| 23 | $reporter->addTag('liip_monitor.additional_reporter', ['alias' => 'foo']); |
|
| 24 | $this->setDefinition('foo_reporter', $reporter); |
|
| 25 | ||
| 26 | $this->compile(); |
|
| 27 | ||
| 28 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
|
| 29 | 'liip_monitor.runner_default', |
|
| 30 | 'addAdditionalReporter', |
|
| 31 | [ |
|
| 32 | 'foo', |
|
| 33 | new Reference('foo_reporter'), |
|
| 34 | ] |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testProcessWithoutAlias() |
|
| 39 | { |
|
| @@ 38-58 (lines=21) @@ | ||
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testProcessWithoutAlias() |
|
| 39 | { |
|
| 40 | $runner = new Definition(); |
|
| 41 | $this->setDefinition('liip_monitor.runner_default', $runner); |
|
| 42 | $this->setParameter('liip_monitor.runners', ['liip_monitor.runner_default']); |
|
| 43 | ||
| 44 | $reporter = new Definition(); |
|
| 45 | $reporter->addTag('liip_monitor.additional_reporter'); |
|
| 46 | $this->setDefinition('foo_reporter', $reporter); |
|
| 47 | ||
| 48 | $this->compile(); |
|
| 49 | ||
| 50 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
|
| 51 | 'liip_monitor.runner_default', |
|
| 52 | 'addAdditionalReporter', |
|
| 53 | [ |
|
| 54 | 'foo_reporter', |
|
| 55 | new Reference('foo_reporter'), |
|
| 56 | ] |
|
| 57 | ); |
|
| 58 | } |
|
| 59 | ||
| 60 | protected function registerCompilerPass(ContainerBuilder $container): void |
|
| 61 | { |
|