eZ\Publish\Core\Repository\Tests\Service\Mock\UrlAliasTest::testCreateGlobalUrlAliasForLocation PHP 메소드

testCreateGlobalUrlAliasForLocation() 공개 메소드

Test for the createGlobalUrlAlias() method.
    public function testCreateGlobalUrlAliasForLocation()
    {
        $repositoryMock = $this->getRepositoryMock();
        $mockedService = $this->getPartlyMockedURLAliasServiceService(array('createUrlAlias'));
        $location = $this->getLocationStub();
        $locationServiceMock = $this->getMock('eZ\\Publish\\Core\\Repository\\LocationService', array(), array(), '', false);
        $locationServiceMock->expects($this->exactly(2))->method('loadLocation')->with($this->equalTo(42))->will($this->returnValue($location));
        $repositoryMock->expects($this->exactly(2))->method('getLocationService')->will($this->returnValue($locationServiceMock));
        $mockedService->expects($this->exactly(2))->method('createUrlAlias')->with($this->equalTo($location), $this->equalTo('path'), $this->equalTo('languageCode'), $this->equalTo('forwarding'), $this->equalTo('alwaysAvailable'));
        $mockedService->createGlobalUrlAlias('eznode:42', 'path', 'languageCode', 'forwarding', 'alwaysAvailable');
        $mockedService->createGlobalUrlAlias('module:content/view/full/42', 'path', 'languageCode', 'forwarding', 'alwaysAvailable');
    }
UrlAliasTest