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

testMatchRequestResourceCaseIncorrectWithForwardRedirect() public method

Tests that forwarding custom alias will redirect to the resource destination rather than to the case-corrected alias.
    public function testMatchRequestResourceCaseIncorrectWithForwardRedirect()
    {
        $pathInfo = '/heLLo_contEnt/hEllo_SEarch';
        $urlAliasPath = '/hello_content/hello_search';
        $destination = '/content/search';
        $urlAlias = new URLAlias(array('destination' => $destination, 'path' => $urlAliasPath, 'type' => UrlAlias::RESOURCE, 'forward' => true));
        $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('needsRedirect'));
        $this->assertSame($destination, $request->attributes->get('semanticPathinfo'));
    }