PHP Class Neos\Flow\Tests\Unit\Mvc\Routing\IdentityRoutePartTest

Inheritance: extends Neos\Flow\Tests\UnitTestCase
Show file Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$identityRoutePart Neos\Flow\Mvc\Routing\IdentityRoutePart
$mockClassSchema Neos\Flow\Reflection\ClassSchema | PHPUnit_Framework_MockObject_MockObject
$mockObjectPathMappingRepository Neos\Flow\Mvc\Routing\ObjectPathMappingRepository | PHPUnit_Framework_MockObject_MockObject
$mockPersistenceManager Neos\Flow\Persistence\PersistenceManagerInterface | PHPUnit_Framework_MockObject_MockObject
$mockReflectionService Neos\Flow\Reflection\ReflectionService | PHPUnit_Framework_MockObject_MockObject

Public Methods

Method Description
createPathSegmentForObjectProvider ( ) : array data provider for createPathSegmentForObjectTests()
createPathSegmentForObjectTests ( object $object, string $uriPattern, string $expectedResult ) : void
createPathSegmentForObjectThrowsInvalidUriPatterExceptionIfItSpecifiedPropertiesContainObjects ( )
findValueToMatchProvider ( ) : array data provider for findValueToMatchTests()
findValueToMatchReturnsAnEmptyStringIfTheCalculatedUriPatternIsEmpty ( )
findValueToMatchReturnsAnEmptyStringIfTheRoutePathIsEmpty ( )
findValueToMatchReturnsAnEmptyStringIfTheSpecifiedSplitStringCantBeFoundInTheRoutePath ( )
findValueToMatchTests ( string $routePath, string $uriPattern, string $splitString, string $expectedResult ) : void
getUriPatternReturnsAnEmptyStringIfObjectTypeHasNotIdentityPropertiesAndNoPatternWasSpecified ( )
getUriPatternReturnsBasedOnTheIdentityPropertiesOfTheObjectTypeIfNoPatternWasSpecified ( )
getUriPatternReturnsTheSpecifiedUriPatternIfItsNotEmpty ( )
matchValueReturnsFalseIfNoObjectPathMappingCouldBeFound ( )
matchValueReturnsFalseIfTheGivenValueIsEmptyOrNull ( )
matchValueSetsCaseSensitiveFlagIfLowerCaseIsFalse ( )
matchValueSetsTheIdentifierOfTheObjectPathMappingAndReturnsTrueIfAMatchingObjectPathMappingWasFound ( )
matchValueSetsTheRouteValueToTheUrlDecodedPathSegmentIfNoUriPatternIsSpecified ( )
resolveValueAcceptsIdentityArrays ( )
resolveValueAppendsCounterIfCreatedPathSegmentIsEmpty ( )
resolveValueAppendsCounterIfNoMatchingObjectPathMappingWasFoundAndCreatedPathSegmentIsNotUnique ( )
resolveValueConvertsCaseOfResolvedPathSegmentIfLowerCaseIsTrue ( )
resolveValueCreatesAndStoresANewObjectPathMappingIfNoMatchingObjectPathMappingWasFound ( )
resolveValueDoesNotAcceptObjectsWithMultiValueIdentifiers ( )
resolveValueKeepsCaseOfResolvedPathSegmentIfLowerCaseIsTrue ( )
resolveValueReturnsFalseIfTheGivenValueIsNotOfTheSpecifiedType ( )
resolveValueSetsCaseSensitiveFlagIfLowerCaseIsFalse ( )
resolveValueSetsTheRouteValueToTheUrlEncodedIdentifierIfNoUriPatternIsSpecified ( ) Makes also sure that identity route parts are encoded via rawurlencode (which encodes spaces to "%20") and not urlencode (which encodes spaces to "+"). According to RFC 3986 that is correct for path segments.
resolveValueSetsTheValueToThePathSegmentOfTheObjectPathMappingAndReturnsTrueIfAMatchingObjectPathMappingWasFound ( )
resolveValueThrowsInfiniteLoopExceptionIfNoUniquePathSegmentCantBeFound ( )
setUp ( ) Sets up this test case

Method Details

createPathSegmentForObjectProvider() public method

data provider for createPathSegmentForObjectTests()

createPathSegmentForObjectTests() public method

public createPathSegmentForObjectTests ( object $object, string $uriPattern, string $expectedResult ) : void
$object object
$uriPattern string
$expectedResult string
return void

createPathSegmentForObjectThrowsInvalidUriPatterExceptionIfItSpecifiedPropertiesContainObjects() public method

findValueToMatchProvider() public method

data provider for findValueToMatchTests()
public findValueToMatchProvider ( ) : array
return array

findValueToMatchReturnsAnEmptyStringIfTheCalculatedUriPatternIsEmpty() public method

findValueToMatchReturnsAnEmptyStringIfTheRoutePathIsEmpty() public method

findValueToMatchReturnsAnEmptyStringIfTheSpecifiedSplitStringCantBeFoundInTheRoutePath() public method

findValueToMatchTests() public method

public findValueToMatchTests ( string $routePath, string $uriPattern, string $splitString, string $expectedResult ) : void
$routePath string
$uriPattern string
$splitString string
$expectedResult string
return void

getUriPatternReturnsAnEmptyStringIfObjectTypeHasNotIdentityPropertiesAndNoPatternWasSpecified() public method

getUriPatternReturnsBasedOnTheIdentityPropertiesOfTheObjectTypeIfNoPatternWasSpecified() public method

getUriPatternReturnsTheSpecifiedUriPatternIfItsNotEmpty() public method

matchValueReturnsFalseIfNoObjectPathMappingCouldBeFound() public method

matchValueReturnsFalseIfTheGivenValueIsEmptyOrNull() public method

matchValueSetsCaseSensitiveFlagIfLowerCaseIsFalse() public method

matchValueSetsTheIdentifierOfTheObjectPathMappingAndReturnsTrueIfAMatchingObjectPathMappingWasFound() public method

matchValueSetsTheRouteValueToTheUrlDecodedPathSegmentIfNoUriPatternIsSpecified() public method

resolveValueAcceptsIdentityArrays() public method

resolveValueAppendsCounterIfCreatedPathSegmentIsEmpty() public method

resolveValueAppendsCounterIfNoMatchingObjectPathMappingWasFoundAndCreatedPathSegmentIsNotUnique() public method

resolveValueConvertsCaseOfResolvedPathSegmentIfLowerCaseIsTrue() public method

resolveValueCreatesAndStoresANewObjectPathMappingIfNoMatchingObjectPathMappingWasFound() public method

resolveValueDoesNotAcceptObjectsWithMultiValueIdentifiers() public method

resolveValueKeepsCaseOfResolvedPathSegmentIfLowerCaseIsTrue() public method

resolveValueReturnsFalseIfTheGivenValueIsNotOfTheSpecifiedType() public method

resolveValueSetsCaseSensitiveFlagIfLowerCaseIsFalse() public method

resolveValueSetsTheRouteValueToTheUrlEncodedIdentifierIfNoUriPatternIsSpecified() public method

Makes also sure that identity route parts are encoded via rawurlencode (which encodes spaces to "%20") and not urlencode (which encodes spaces to "+"). According to RFC 3986 that is correct for path segments.

resolveValueSetsTheValueToThePathSegmentOfTheObjectPathMappingAndReturnsTrueIfAMatchingObjectPathMappingWasFound() public method

resolveValueThrowsInfiniteLoopExceptionIfNoUniquePathSegmentCantBeFound() public method

setUp() public method

Sets up this test case
public setUp ( )

Property Details

$identityRoutePart protected property

protected IdentityRoutePart,Neos\Flow\Mvc\Routing $identityRoutePart
return Neos\Flow\Mvc\Routing\IdentityRoutePart

$mockClassSchema protected property

protected ClassSchema,Neos\Flow\Reflection|PHPUnit_Framework_MockObject_MockObject $mockClassSchema
return Neos\Flow\Reflection\ClassSchema | PHPUnit_Framework_MockObject_MockObject

$mockObjectPathMappingRepository protected property

protected ObjectPathMappingRepository,Neos\Flow\Mvc\Routing|PHPUnit_Framework_MockObject_MockObject $mockObjectPathMappingRepository
return Neos\Flow\Mvc\Routing\ObjectPathMappingRepository | PHPUnit_Framework_MockObject_MockObject

$mockPersistenceManager protected property

protected PersistenceManagerInterface,Neos\Flow\Persistence|PHPUnit_Framework_MockObject_MockObject $mockPersistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface | PHPUnit_Framework_MockObject_MockObject

$mockReflectionService protected property

protected ReflectionService,Neos\Flow\Reflection|PHPUnit_Framework_MockObject_MockObject $mockReflectionService
return Neos\Flow\Reflection\ReflectionService | PHPUnit_Framework_MockObject_MockObject