| @@ 23-50 (lines=28) @@ | ||
| 20 | * |
|
| 21 | * @author Simon Ball <simonball at simonball dot me> |
|
| 22 | */ |
|
| 23 | class ReportPatternCompilerTest extends AbstractCompilerPassTestCase |
|
| 24 | { |
|
| 25 | protected function registerCompilerPass(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | $container->addCompilerPass(new ReportPatternPass()); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function reportPatternTest() |
|
| 31 | { |
|
| 32 | $collectingService = new Definition(); |
|
| 33 | $this->setDefinition('symball_report.pattern', $collectingService); |
|
| 34 | ||
| 35 | $collectedService = new Definition(); |
|
| 36 | $collectedService->addTag('symball_report.pattern', ['alias' => 'test_alias']); |
|
| 37 | $this->setDefinition('some_unimportant_service_id', $collectedService); |
|
| 38 | ||
| 39 | $this->compile(); |
|
| 40 | ||
| 41 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
|
| 42 | 'symball_report.pattern', |
|
| 43 | 'add', |
|
| 44 | array( |
|
| 45 | new Reference('some_unimportant_service_id') |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | ||
| 49 | } |
|
| 50 | } |
|
| @@ 23-50 (lines=28) @@ | ||
| 20 | * |
|
| 21 | * @author Simon Ball <simonball at simonball dot me> |
|
| 22 | */ |
|
| 23 | class ReportQueryCompilerTest extends AbstractCompilerPassTestCase |
|
| 24 | { |
|
| 25 | protected function registerCompilerPass(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | $container->addCompilerPass(new ReportQueryPass()); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function reportQueryTest() |
|
| 31 | { |
|
| 32 | $collectingService = new Definition(); |
|
| 33 | $this->setDefinition('symball_report.style', $collectingService); |
|
| 34 | ||
| 35 | $collectedService = new Definition(); |
|
| 36 | $collectedService->addTag('symball_report.pattern', ['alias' => 'test_alias']); |
|
| 37 | $this->setDefinition('some_unimportant_service_id', $collectedService); |
|
| 38 | ||
| 39 | $this->compile(); |
|
| 40 | ||
| 41 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
|
| 42 | 'symball_report.style', |
|
| 43 | 'add', |
|
| 44 | array( |
|
| 45 | new Reference('some_unimportant_service_id') |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | ||
| 49 | } |
|
| 50 | } |
|
| @@ 23-50 (lines=28) @@ | ||
| 20 | * |
|
| 21 | * @author Simon Ball <simonball at simonball dot me> |
|
| 22 | */ |
|
| 23 | class ReportStyleCompilerTest extends AbstractCompilerPassTestCase |
|
| 24 | { |
|
| 25 | protected function registerCompilerPass(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | $container->addCompilerPass(new ReportStylePass()); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function reportStyleTest() |
|
| 31 | { |
|
| 32 | $collectingService = new Definition(); |
|
| 33 | $this->setDefinition('symball_report.style', $collectingService); |
|
| 34 | ||
| 35 | $collectedService = new Definition(); |
|
| 36 | $collectedService->addTag('symball_report.style', ['alias' => 'test_alias']); |
|
| 37 | $this->setDefinition('some_unimportant_service_id', $collectedService); |
|
| 38 | ||
| 39 | $this->compile(); |
|
| 40 | ||
| 41 | $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( |
|
| 42 | 'symball_report.style', |
|
| 43 | 'add', |
|
| 44 | array( |
|
| 45 | new Reference('some_unimportant_service_id') |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | ||
| 49 | } |
|
| 50 | } |
|