PHP Class eZ\Publish\Core\Persistence\Legacy\Tests\Content\UrlAliasHandlerTest

Datei anzeigen Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$dbHandler eZ\Publish\Core\Persistence\Doctrine\ConnectionHandler
$languageHandler eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler
$languageMaskGenerator eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway

Public Methods

Method Description
getProcessor ( ) : TransformationProcessor
providerForTestLookupCustomLocationUrlAlias ( )
providerForTestLookupLocationMultipleLanguages ( )
providerForTestLookupLocationUrlAlias ( )
providerForTestLookupResourceUrlAlias ( )
providerForTestLookupVirtualUrlAlias ( )
providerForTestPublishUrlAliasForLocationComplex ( ) : array
providerForTestPublishUrlAliasForLocationSkipsReservedWord ( )
testCreateCustomUrlAlias ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasBehaviour ( ) Test for the createCustomUrlAlias() method.
testCreateCustomUrlAliasReusesHistory ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasReusesHistoryOfDifferentLanguage ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasReusesLocationElement ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasReusesNopElement ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasWithNonameParts ( ) Test for the createUrlAlias() method.
testCreateCustomUrlAliasWithNopElement ( ) Test for the createUrlAlias() method.
testCreateGlobalUrlAliasBehaviour ( ) Test for the createGlobalUrlAlias() method.
testCreateUrlAliasWithNopElementCreatesValidNopElement ( Handler $handler ) Test for the createUrlAlias() method.
testCreatedCustomUrlAliasIsLoadable ( ) Test for the createUrlAlias() method.
testListGlobalURLAliases ( ) Test for the listGlobalURLAliases() method.
testListGlobalURLAliasesWithLanguageCode ( ) Test for the listGlobalURLAliases() method.
testListGlobalURLAliasesWithOffset ( ) Test for the listGlobalURLAliases() method.
testListGlobalURLAliasesWithOffsetAndLimit ( ) Test for the listGlobalURLAliases() method.
testListURLAliasesForLocation ( ) Test for the listURLAliasesForLocation() method.
testLoadAutogeneratedUrlAlias ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id ) Test for the loadUrlAlias() method.
testLoadHistoryUrlAlias ( ) Test for the loadUrlAlias() method.
testLoadResourceUrlAlias ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id ) Test for the loadUrlAlias() method.
testLoadUrlAliasThrowsNotFoundException ( ) Test for the loadUrlAlias() method.
testLoadVirtualUrlAlias ( $url, $id ) Test for the loadUrlAlias() method.
testLocationCopiedCopiedLocationAliasIsValid ( ) Test for the locationCopied() method.
testLocationCopiedCopiedSubtreeIsValid ( ) Test for the locationCopied() method.
testLocationCopiedHistoryNotCopied ( ) Test for the locationCopied() method.
testLocationCopiedSubtree ( ) Test for the locationCopied() method.
testLocationCopiedSubtreeHistoryNotCopied ( ) Test for the locationCopied() method.
testLocationDeleted ( ) Test for the locationDeleted() method.
testLocationMovedHistorize ( ) Test for the locationMoved() method.
testLocationMovedHistory ( ) Test for the locationMoved() method.
testLocationMovedHistorySubtree ( ) Test for the locationMoved() method.
testLocationMovedReparent ( ) Test for the locationMoved() method.
testLocationMovedReparentHistory ( ) Test for the locationMoved() method.
testLocationMovedReparentSubtree ( ) Test for the locationMoved() method.
testLocationMovedReparentSubtreeHistory ( ) Test for the locationMoved() method.
testLocationSwappedMultipleLanguagesDifferentLanguages ( ) Test for the locationSwapped() method.
testLocationSwappedMultipleLanguagesDifferentLanguagesSimple ( ) Test for the locationSwapped() method.
testLocationSwappedMultipleLanguagesSimple ( ) Test for the locationSwapped() method.
testLocationSwappedMultipleLanguagesUpdatesLocationPathIdentificationString ( ) Test for the locationSwapped() method.
testLocationSwappedMultipleLanguagesWithCompositeHistory ( ) Test for the locationSwapped() method.
testLocationSwappedSiblingsSimple ( ) Test for the locationSwapped() method.
testLocationSwappedSiblingsSimpleReverse ( ) Test for the locationSwapped() method.
testLocationSwappedSiblingsSimpleWithHistory ( ) Test for the locationSwapped() method.
testLocationSwappedSiblingsSimpleWithHistoryReverse ( ) Test for the locationSwapped() method.
testLocationSwappedSimple ( ) Test for the locationSwapped() method.
testLocationSwappedSimpleWithConflict ( ) Test for the locationSwapped() method.
testLocationSwappedSimpleWithHistory ( ) Test for the locationSwapped() method.
testLocationSwappedUpdatesLocationPathIdentificationString ( ) Test for the locationSwapped() method.
testLocationSwappedWithReusingExternalHistory ( ) Test for the locationSwapped() method.
testLocationSwappedWithReusingNopEntry ( ) Test for the locationSwapped() method.
testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed ( ) Test for the locationSwapped() method.
testLookup ( ) Test for the lookup() method.
testLookupCustomLocationUrlAlias ( $url, array $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id ) Test for the lookup() method.
testLookupCustomLocationUrlAliasCaseCorrection ( $url, array $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id ) Test for the lookup() method.
testLookupLocationCaseCorrection ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id ) Testing that looking up case incorrect URL results in redirection to case correct path.
testLookupLocationHistoryUrlAlias ( ) Test for the lookup() method.
testLookupLocationMultipleLanguages ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id ) Test for the lookup() method.
testLookupLocationUrlAlias ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id ) Test for the lookup() method.
testLookupResourceUrlAlias ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id ) Test for the lookup() method.
testLookupResourceUrlAliasCaseInsensitive ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id ) Test for the lookup() method.
testLookupThrowsNotFoundException ( ) Test for the lookup() method.
testLookupUppercaseIri ( ) Test for the lookup() method with uppercase utf8 characters.
testLookupVirtualUrlAlias ( $url, $id ) Test for the lookup() method.
testPublishUrlAliasCreatesUniqueAlias ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocation ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationComplex ( $url, $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationDowngradesOldEntryRemovesLanguage ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationDowngradesOldEntryToHistory ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationRepublish ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusesCustomAlias ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusesHistory ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusesHistoryOfDifferentLanguage ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusingNopElement ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusingNopElementChangesCustomPath ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationReusingNopElementChangesCustomPathAndCreatesHistory ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationSameAliasForMultipleLanguages ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationSkipsReservedWord ( $text, $alias ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasForLocationUpdatesLocationPathIdentificationString ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasReuseAutogeneratedCleanup ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasReuseHistoryCleanup ( ) Test for the publishUrlAliasForLocation() method.
testPublishUrlAliasReuseNopCleanupCustomAliasIsDestroyed ( ) Test for the publishUrlAliasForLocation() method.

Protected Methods

Method Description
assertVirtualUrlAliasValid ( eZ\Publish\SPI\Persistence\Content\UrlAlias $urlAlias, $id )
countRows ( ) : integer
dump ( )
getHandler ( ) : Handler
getHistoryAlias ( )
getLanguageHandler ( ) : Handler
getLanguageMaskGenerator ( ) : MaskGenerator
getLocationGateway ( ) : Gateway
getPartlyMockedHandler ( array $methods ) : Handler | PHPUnit_Framework_MockObject_MockObject

Method Details

assertVirtualUrlAliasValid() protected method

protected assertVirtualUrlAliasValid ( eZ\Publish\SPI\Persistence\Content\UrlAlias $urlAlias, $id )
$urlAlias eZ\Publish\SPI\Persistence\Content\UrlAlias

countRows() protected method

protected countRows ( ) : integer
return integer

dump() protected method

protected dump ( )

getHandler() protected method

protected getHandler ( ) : Handler
return eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler

getHistoryAlias() protected method

protected getHistoryAlias ( )

getLanguageHandler() protected method

protected getLanguageHandler ( ) : Handler
return eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler

getLanguageMaskGenerator() protected method

protected getLanguageMaskGenerator ( ) : MaskGenerator
return eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator

getLocationGateway() protected method

protected getLocationGateway ( ) : Gateway
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway

getPartlyMockedHandler() protected method

protected getPartlyMockedHandler ( array $methods ) : Handler | PHPUnit_Framework_MockObject_MockObject
$methods array
return eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler | PHPUnit_Framework_MockObject_MockObject

getProcessor() public method

public getProcessor ( ) : TransformationProcessor
return eZ\Publish\Core\Persistence\TransformationProcessor

providerForTestLookupCustomLocationUrlAlias() public method

providerForTestLookupLocationMultipleLanguages() public method

providerForTestLookupLocationUrlAlias() public method

providerForTestLookupResourceUrlAlias() public method

providerForTestLookupVirtualUrlAlias() public method

providerForTestPublishUrlAliasForLocationComplex() public method

providerForTestPublishUrlAliasForLocationSkipsReservedWord() public method

testCreateCustomUrlAlias() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasBehaviour() public method

Test for the createCustomUrlAlias() method.

testCreateCustomUrlAliasReusesHistory() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasReusesHistoryOfDifferentLanguage() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasReusesLocationElement() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasReusesNopElement() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasWithNonameParts() public method

Test for the createUrlAlias() method.

testCreateCustomUrlAliasWithNopElement() public method

Test for the createUrlAlias() method.

testCreateGlobalUrlAliasBehaviour() public method

Test for the createGlobalUrlAlias() method.

testCreateUrlAliasWithNopElementCreatesValidNopElement() public method

Test for the createUrlAlias() method.
public testCreateUrlAliasWithNopElementCreatesValidNopElement ( Handler $handler )
$handler eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler

testCreatedCustomUrlAliasIsLoadable() public method

Test for the createUrlAlias() method.

testListGlobalURLAliases() public method

Test for the listGlobalURLAliases() method.

testListGlobalURLAliasesWithLanguageCode() public method

Test for the listGlobalURLAliases() method.

testListGlobalURLAliasesWithOffset() public method

Test for the listGlobalURLAliases() method.

testListGlobalURLAliasesWithOffsetAndLimit() public method

Test for the listGlobalURLAliases() method.

testListURLAliasesForLocation() public method

Test for the listURLAliasesForLocation() method.

testLoadAutogeneratedUrlAlias() public method

Test for the loadUrlAlias() method.
public testLoadAutogeneratedUrlAlias ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id )
$pathData array
$languageCodes array

testLoadHistoryUrlAlias() public method

Test for the loadUrlAlias() method.

testLoadResourceUrlAlias() public method

Test for the loadUrlAlias() method.
public testLoadResourceUrlAlias ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id )
$languageCodes array

testLoadUrlAliasThrowsNotFoundException() public method

Test for the loadUrlAlias() method.

testLoadVirtualUrlAlias() public method

Test for the loadUrlAlias() method.
public testLoadVirtualUrlAlias ( $url, $id )

testLocationCopiedCopiedLocationAliasIsValid() public method

Test for the locationCopied() method.

testLocationCopiedCopiedSubtreeIsValid() public method

Test for the locationCopied() method.

testLocationCopiedHistoryNotCopied() public method

Test for the locationCopied() method.

testLocationCopiedSubtree() public method

Test for the locationCopied() method.

testLocationCopiedSubtreeHistoryNotCopied() public method

Test for the locationCopied() method.

testLocationDeleted() public method

Test for the locationDeleted() method.
public testLocationDeleted ( )

testLocationMovedHistorize() public method

Test for the locationMoved() method.

testLocationMovedHistory() public method

Test for the locationMoved() method.

testLocationMovedHistorySubtree() public method

Test for the locationMoved() method.

testLocationMovedReparent() public method

Test for the locationMoved() method.

testLocationMovedReparentHistory() public method

Test for the locationMoved() method.

testLocationMovedReparentSubtree() public method

Test for the locationMoved() method.

testLocationMovedReparentSubtreeHistory() public method

Test for the locationMoved() method.

testLocationSwappedMultipleLanguagesDifferentLanguages() public method

Test for the locationSwapped() method.

testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() public method

Test for the locationSwapped() method.

testLocationSwappedMultipleLanguagesSimple() public method

Test for the locationSwapped() method.

testLocationSwappedMultipleLanguagesUpdatesLocationPathIdentificationString() public method

Test for the locationSwapped() method.

testLocationSwappedMultipleLanguagesWithCompositeHistory() public method

Test for the locationSwapped() method.

testLocationSwappedSiblingsSimple() public method

Test for the locationSwapped() method.

testLocationSwappedSiblingsSimpleReverse() public method

Test for the locationSwapped() method.

testLocationSwappedSiblingsSimpleWithHistory() public method

Test for the locationSwapped() method.

testLocationSwappedSiblingsSimpleWithHistoryReverse() public method

Test for the locationSwapped() method.

testLocationSwappedSimple() public method

Test for the locationSwapped() method.

testLocationSwappedSimpleWithConflict() public method

Test for the locationSwapped() method.

testLocationSwappedSimpleWithHistory() public method

Test for the locationSwapped() method.

testLocationSwappedUpdatesLocationPathIdentificationString() public method

Test for the locationSwapped() method.

testLocationSwappedWithReusingExternalHistory() public method

Test for the locationSwapped() method.

testLocationSwappedWithReusingNopEntry() public method

Test for the locationSwapped() method.

testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed() public method

Test for the locationSwapped() method.

testLookup() public method

Simple lookup case.
public testLookup ( )

testLookupCustomLocationUrlAlias() public method

Testing that UrlAlias is found and has expected state.
public testLookupCustomLocationUrlAlias ( $url, array $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id )
$pathData array
$languageCodes array

testLookupCustomLocationUrlAliasCaseCorrection() public method

Testing that UrlAlias is found and has expected state.
public testLookupCustomLocationUrlAliasCaseCorrection ( $url, array $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id )
$pathData array
$languageCodes array

testLookupLocationCaseCorrection() public method

Note that case corrected path is not always equal to case corrected case incorrect path, eg. "JEDAN/TWO/THREE" will not always redirect to "jedan/two/three". In some cases, depending on list of prioritized languages and if Content available in the different language higher in the list of prioritized languages, path showing to that Content will be used. Example: "JEDAN/TWO/DREI" with "eng-GB" and "ger-DE" as prioritized languages will produce redirection to the "jedan/two/three", as "eng-GB" is the most prioritized language and Content that URL alias is pointing to is available in it.
public testLookupLocationCaseCorrection ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id )
$pathData array
$languageCodes array

testLookupLocationHistoryUrlAlias() public method

Test for the lookup() method.

testLookupLocationMultipleLanguages() public method

Test for the lookup() method.
public testLookupLocationMultipleLanguages ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id )
$pathData array
$languageCodes array

testLookupLocationUrlAlias() public method

Testing that UrlAlias is found and has expected state.
public testLookupLocationUrlAlias ( $url, array $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id )
$pathData array
$languageCodes array

testLookupResourceUrlAlias() public method

Testing that UrlAlias is found and has expected state.
public testLookupResourceUrlAlias ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id )
$languageCodes array

testLookupResourceUrlAliasCaseInsensitive() public method

Testing that UrlAlias is found and has expected state.
public testLookupResourceUrlAliasCaseInsensitive ( $url, $pathData, array $languageCodes, $forward, $alwaysAvailable, $destination, $id )
$languageCodes array

testLookupThrowsNotFoundException() public method

Trying to lookup non existent URL alias throws NotFoundException.

testLookupUppercaseIri() public method

Test for the lookup() method with uppercase utf8 characters.

testLookupVirtualUrlAlias() public method

Testing that NOP action redirects to site root.
public testLookupVirtualUrlAlias ( $url, $id )

testPublishUrlAliasCreatesUniqueAlias() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocation() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationComplex() public method

Test for the publishUrlAliasForLocation() method.
public testPublishUrlAliasForLocationComplex ( $url, $pathData, array $languageCodes, $alwaysAvailable, $locationId, $id )
$languageCodes array

testPublishUrlAliasForLocationDowngradesOldEntryRemovesLanguage() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationDowngradesOldEntryToHistory() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationRepublish() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusesCustomAlias() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusesHistory() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusesHistoryOfDifferentLanguage() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusingNopElement() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusingNopElementChangesCustomPath() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationReusingNopElementChangesCustomPathAndCreatesHistory() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationSameAliasForMultipleLanguages() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationSkipsReservedWord() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasForLocationUpdatesLocationPathIdentificationString() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasReuseAutogeneratedCleanup() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasReuseHistoryCleanup() public method

Test for the publishUrlAliasForLocation() method.

testPublishUrlAliasReuseNopCleanupCustomAliasIsDestroyed() public method

Test for the publishUrlAliasForLocation() method.

Property Details

$dbHandler protected_oe property

protected ConnectionHandler,eZ\Publish\Core\Persistence\Doctrine $dbHandler
return eZ\Publish\Core\Persistence\Doctrine\ConnectionHandler

$languageHandler protected_oe property

protected Handler,eZ\Publish\Core\Persistence\Legacy\Content\Language $languageHandler
return eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler

$languageMaskGenerator protected_oe property

protected MaskGenerator,eZ\Publish\Core\Persistence\Legacy\Content\Language $languageMaskGenerator
return eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator

$locationGateway protected_oe property

protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationGateway
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway