public function ChainRouterTest::testContextOrder

context must be propagated also when routers are added after context is set

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/Routing/ChainRouterTest.php, line 138

Class

ChainRouterTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function testContextOrder() {
  list($low, $high) = $this
    ->createRouterMocks();
  $low
    ->expects($this
    ->once())
    ->method('setContext')
    ->with($this->context);
  $high
    ->expects($this
    ->once())
    ->method('setContext')
    ->with($this->context);
  $this->router
    ->setContext($this->context);
  $this->router
    ->add($low, 10);
  $this->router
    ->add($high, 100);
  $this->router
    ->all();
  $this
    ->assertSame($this->context, $this->router
    ->getContext());
}