eZ\Publish\Core\MVC\Symfony\Security\Tests\HttpUtilsTest::testGenerateUriStandard PHP Method

testGenerateUriStandard() public method

public testGenerateUriStandard ( $uri, $isUriRouteName, $expected )
    public function testGenerateUriStandard($uri, $isUriRouteName, $expected)
    {
        $urlGenerator = $this->getMock('Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface');
        $httpUtils = new HttpUtils($urlGenerator);
        $httpUtils->setSiteAccess(new SiteAccess());
        $request = Request::create('http://ezpublish.dev/');
        $request->attributes->set('siteaccess', new SiteAccess('test'));
        $requestAttributes = array('foo' => 'bar', 'some' => 'thing');
        $request->attributes->add($requestAttributes);
        if ($isUriRouteName) {
            $urlGenerator->expects($this->once())->method('generate')->with($uri, $requestAttributes, UrlGeneratorInterface::ABSOLUTE_URL)->will($this->returnValue($expected . '?' . http_build_query($requestAttributes)));
        }
        $this->assertSame($expected, $httpUtils->generateUri($request, $uri));
    }