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

testMatchRequestVirtual() public method

    public function testMatchRequestVirtual()
    {
        $pathInfo = '/foo/bar';
        $urlAlias = new URLAlias(array('path' => $pathInfo, 'type' => UrlAlias::VIRTUAL));
        $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->assertTrue($request->attributes->get('needsForward'));
        $this->assertSame('/', $request->attributes->get('semanticPathinfo'));
    }