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

testGenerateWithLocationId() public method

    public function testGenerateWithLocationId()
    {
        $locationId = 123;
        $location = new Location(array('id' => $locationId));
        $parameters = array('some' => 'thing');
        $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH;
        $generatedLink = '/foo/bar';
        $this->locationService->expects($this->once())->method('loadLocation')->with($locationId)->will($this->returnValue($location));
        $this->urlALiasGenerator->expects($this->once())->method('generate')->with($location, $parameters, $referenceType)->will($this->returnValue($generatedLink));
        $this->assertSame($generatedLink, $this->router->generate(UrlAliasRouter::URL_ALIAS_ROUTE_NAME, $parameters + array('locationId' => $locationId), $referenceType));
    }