RoutingResolverPassTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Routing\Tests\DependencyInjection;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Config\Loader\LoaderResolver;
  13. use Symfony\Component\DependencyInjection\ContainerBuilder;
  14. use Symfony\Component\DependencyInjection\Reference;
  15. use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass;
  16. class RoutingResolverPassTest extends TestCase
  17. {
  18. public function testProcess()
  19. {
  20. $container = new ContainerBuilder();
  21. $container->register('routing.resolver', LoaderResolver::class);
  22. $container->register('loader1')->addTag('routing.loader');
  23. $container->register('loader2')->addTag('routing.loader');
  24. (new RoutingResolverPass())->process($container);
  25. $this->assertEquals(
  26. array(array('addLoader', array(new Reference('loader1'))), array('addLoader', array(new Reference('loader2')))),
  27. $container->getDefinition('routing.resolver')->getMethodCalls()
  28. );
  29. }
  30. }