You are here

public function RegisterRoutersPassTest::testNoChainRouter in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRoutersPassTest.php \Symfony\Cmf\Routing\Tests\DependencyInjection\Compiler\RegisterRoutersPassTest::testNoChainRouter()

If there is no chain router defined in the container builder, nothing should be processed.

File

vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRoutersPassTest.php, line 79

Class

RegisterRoutersPassTest

Namespace

Symfony\Cmf\Routing\Tests\DependencyInjection\Compiler

Code

public function testNoChainRouter() {
  $builder = $this
    ->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder', array(
    'hasDefinition',
    'findTaggedServiceIds',
    'getDefinition',
  ));
  $builder
    ->expects($this
    ->once())
    ->method('hasDefinition')
    ->with('cmf_routing.router')
    ->will($this
    ->returnValue(false));
  $builder
    ->expects($this
    ->never())
    ->method('findTaggedServiceIds');
  $builder
    ->expects($this
    ->never())
    ->method('getDefinition');
  $registerRoutersPass = new RegisterRoutersPass();
  $registerRoutersPass
    ->process($builder);
}