You are here

public function ChainRouterTest::testMatchWithRequestMatchersNotFound in Zircon Profile 8

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

Call match on ChainRouter that has RequestMatcher in the chain.

@expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException @expectedExceptionMessage None of the routers in the chain matched url '/test'

File

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

Class

ChainRouterTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function testMatchWithRequestMatchersNotFound() {
  $url = '/test';
  $request = Request::create('/test');
  $high = $this
    ->getMock('Symfony\\Cmf\\Component\\Routing\\Tests\\Routing\\RequestMatcher');
  $high
    ->expects($this
    ->once())
    ->method('matchRequest')
    ->with($request)
    ->will($this
    ->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException()));
  $this->router
    ->add($high, 20);
  $this->router
    ->match($url);
}