You are here

public function ChainRouterTest::testContextOrder in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\ChainRouterTest::testContextOrder()

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

File

vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php, line 166

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());
}