You are here

public function ChainRouterTest::testGenerateNotFound 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::testGenerateNotFound()

@expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException

File

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

Class

ChainRouterTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function testGenerateNotFound() {
  $name = 'test';
  $parameters = array(
    'test' => 'value',
  );
  list($low, $high) = $this
    ->createRouterMocks();
  $high
    ->expects($this
    ->once())
    ->method('generate')
    ->with($name, $parameters, false)
    ->will($this
    ->throwException(new RouteNotFoundException()));
  $low
    ->expects($this
    ->once())
    ->method('generate')
    ->with($name, $parameters, false)
    ->will($this
    ->throwException(new RouteNotFoundException()));
  $this->router
    ->add($low, 10);
  $this->router
    ->add($high, 100);
  $this->router
    ->generate($name, $parameters);
}