eZ\Publish\Core\MVC\Symfony\Routing\Tests\UrlAliasRouterTest::testMatchRequestResource PHP Method

testMatchRequestResource() public method

    public function testMatchRequestResource()
    {
        $pathInfo = '/hello_content/hello_search';
        $destination = '/content/search';
        $urlAlias = new URLAlias(array('destination' => $destination, 'path' => $pathInfo, 'type' => UrlAlias::RESOURCE));
        $request = $this->getRequestByPathInfo($pathInfo);
        $this->urlAliasService->expects($this->once())->method('lookup')->with($pathInfo)->will($this->returnValue($urlAlias));
        $expected = array('_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME);
        $this->assertEquals($expected, $this->router->matchRequest($request));
        $this->assertSame($destination, $request->attributes->get('semanticPathinfo'));
    }