public function ChainRouterTest::testMatchRequestMethodNotAllowed

If any of the routers throws a not allowed exception and no other matches, we need to see this

@expectedException \Symfony\Component\Routing\Exception\MethodNotAllowedException

File

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

Class

ChainRouterTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function testMatchRequestMethodNotAllowed() {
  $url = '/test';
  list($low, $high) = $this
    ->createRouterMocks();
  $high
    ->expects($this
    ->once())
    ->method('match')
    ->with($url)
    ->will($this
    ->throwException(new \Symfony\Component\Routing\Exception\MethodNotAllowedException(array())));
  $low
    ->expects($this
    ->once())
    ->method('match')
    ->with($url)
    ->will($this
    ->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException()));
  $this->router
    ->add($low, 10);
  $this->router
    ->add($high, 100);
  $this->router
    ->matchRequest(Request::create('/test'));
}