|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\Tests\Unit\DependencyInjection\Factory; |
| 4 | + |
| 5 | +/** |
| 6 | + * @author Maximilian Berghoff <[email protected]> |
| 7 | + */ |
| 8 | +class RoutingAdminFactoryTest extends AbstractFactoryTest |
| 9 | +{ |
| 10 | + public function testParametersBundle() |
| 11 | + { |
| 12 | + $this->container->setParameter('kernel.bundles', [ |
| 13 | + 'CmfRoutingBundle' => true, |
| 14 | + 'SonataDoctrinePHPCRAdminBundle' => true, |
| 15 | + 'CmfSonataPhpcrAdminIntegrationBundle.' => true, |
| 16 | + ]); |
| 17 | + $this->load([ |
| 18 | + 'bundles' => [ |
| 19 | + 'routing' => [ |
| 20 | + 'enabled' => true, |
| 21 | + 'extensions' => [ |
| 22 | + 'referrers' => ['form_group' => 'referrers_form_group'], |
| 23 | + ], |
| 24 | + ], |
| 25 | + ], |
| 26 | + ]); |
| 27 | + |
| 28 | + $this->assertContainerBuilderHasParameter( |
| 29 | + 'cmf_sonata_phpcr_admin_integration.routing.extension.referrers.from_group', |
| 30 | + 'referrers_form_group' |
| 31 | + ); |
| 32 | + $this->assertContainerBuilderHasParameter( |
| 33 | + 'cmf_sonata_phpcr_admin_integration.routing.extension.referrers.from_tab', |
| 34 | + 'form.tab_routes' |
| 35 | + ); |
| 36 | + } |
| 37 | + |
| 38 | + public function testAdminServicesBundle() |
| 39 | + { |
| 40 | + |
| 41 | + $this->container->setParameter( |
| 42 | + 'kernel.bundles', |
| 43 | + [ |
| 44 | + 'CmfRoutingBundle' => true, |
| 45 | + 'SonataDoctrinePHPCRAdminBundle' => true, |
| 46 | + 'DoctrinePHPCRBundle' => true, |
| 47 | + ] |
| 48 | + ); |
| 49 | + |
| 50 | + $this->load([ |
| 51 | + 'bundles' => [ |
| 52 | + 'routing' => true, |
| 53 | + ], |
| 54 | + ]); |
| 55 | + |
| 56 | + $this->assertContainerBuilderHasService( |
| 57 | + 'cmf_sonata_phpcr_admin_integration.routing.route_admin' |
| 58 | + ); |
| 59 | + $this->assertContainerBuilderHasService( |
| 60 | + 'cmf_sonata_phpcr_admin_integration.routing.redirect_route_admin' |
| 61 | + ); |
| 62 | + $this->assertContainerBuilderHasService( |
| 63 | + 'cmf_sonata_phpcr_admin_integration.routing.extension.route_referrers' |
| 64 | + ); |
| 65 | + $this->assertContainerBuilderHasService( |
| 66 | + 'cmf_sonata_phpcr_admin_integration.routing.extension.frontend_link' |
| 67 | + ); |
| 68 | + } |
| 69 | +} |
0 commit comments