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

testMatchRequestVirtualWithCaseRedirect() public method

    public function testMatchRequestVirtualWithCaseRedirect()
    {
        $pathInfo = '/Foo/bAR';
        $urlAliasPath = '/foo/bar';
        $urlAlias = new URLAlias(array('path' => $urlAliasPath, 'type' => UrlAlias::VIRTUAL));
        $request = $this->getRequestByPathInfo($pathInfo);
        $this->urlALiasGenerator->expects($this->once())->method('isUriPrefixExcluded')->with($pathInfo)->will($this->returnValue(false));
        $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('needsRedirect'));
        $this->assertSame($urlAliasPath, $request->attributes->get('semanticPathinfo'));
    }