You are here

public function RouterListenerTest::testRequestMatcher in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/EventListener/RouterListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\RouterListenerTest::testRequestMatcher()

File

vendor/symfony/http-kernel/Tests/EventListener/RouterListenerTest.php, line 86

Class

RouterListenerTest

Namespace

Symfony\Component\HttpKernel\Tests\EventListener

Code

public function testRequestMatcher() {
  $kernel = $this
    ->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
  $request = Request::create('http://localhost/');
  $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
  $requestMatcher = $this
    ->getMock('Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface');
  $requestMatcher
    ->expects($this
    ->once())
    ->method('matchRequest')
    ->with($this
    ->isInstanceOf('Symfony\\Component\\HttpFoundation\\Request'))
    ->will($this
    ->returnValue(array()));
  $listener = new RouterListener($requestMatcher, new RequestContext(), null, $this->requestStack);
  $listener
    ->onKernelRequest($event);
}