You are here

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

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

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

Class

ChainRouterTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function testMatchMethodNotAllowed() {
  $url = '/test';
  list($low, $high) = $this
    ->createRouterMocks();
  $high
    ->expects($this
    ->once())
    ->method('match')
    ->with($url)
    ->will($this
    ->throwException(new MethodNotAllowedException(array())));
  $low
    ->expects($this
    ->once())
    ->method('match')
    ->with($url)
    ->will($this
    ->throwException(new ResourceNotFoundException()));
  $this->router
    ->add($low, 10);
  $this->router
    ->add($high, 100);
  $this->router
    ->match('/test');
}