‪TYPO3CMS  10.4
TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest:

Public Member Functions

 filterByValueRecursive ()
 
 filterByValueRecursiveCorrectlyFiltersArray ($needle, $haystack, $expectedResult)
 
 filterByValueRecursiveMatchesReferencesToSameObject ()
 
 filterByValueRecursiveDoesNotMatchDifferentInstancesOfSameClass ()
 
 isValidPathReturnsTrueIfPathExists ()
 
 isValidPathReturnsFalseIfPathDoesNotExist ()
 
 getValueByPathThrowsExceptionIfPathIsNotString ()
 
 getValueByPathThrowsExceptionIfPathIsEmpty ()
 
 getValueByPathReturnsFirstIndexIfPathIsZero ()
 
 getValueByPathReturnsFirstIndexIfPathSegmentIsZero ()
 
array getValueByPathInvalidPathDataProvider ()
 
 getValueByPathThrowsExceptionIfPathNotExists (array $array, $path)
 
 getValueByPathThrowsSpecificExceptionIfPathNotExists (array $array, string $path)
 
 getValueByPathValidDataProvider ()
 
 getValueByPathGetsCorrectValue (array $array, $path, $expectedResult)
 
 getValueByPathAcceptsDifferentDelimiter ()
 
 setValueByPathThrowsExceptionIfPathIsEmpty ()
 
 setValueByPathThrowsExceptionIfPathIsNotAString ()
 
 setValueByPathThrowsExceptionIfPathSegmentIsEmpty ()
 
 setValueByPathCanUseZeroAsPathSegment ()
 
 setValueByPathCanUseZeroAsPath ()
 
 setValueByPathSetsCorrectValueDataProvider ()
 
 setValueByPathSetsCorrectValue (array $array, $path, $value, $expectedResult)
 
 removeByPathThrowsExceptionIfPathIsEmpty ()
 
 removeByPathThrowsExceptionIfPathIsNotAString ()
 
 removeByPathThrowsExceptionWithEmptyPathSegment ()
 
 removeByPathRemovesFirstIndexWithZeroAsPathSegment ()
 
 removeByPathRemovesFirstIndexWithZeroAsPath ()
 
 removeByPathThrowsExceptionIfPathDoesNotExistInArray ()
 
 removeByPathThrowsSpecificExceptionIfPathDoesNotExistInArray ()
 
 removeByPathAcceptsGivenDelimiter ()
 
 removeByPathRemovesCorrectPathDataProvider ()
 
 removeByPathRemovesCorrectPath (array $array, $path, $expectedResult)
 
 sortByKeyRecursiveCheckIfSortingIsCorrect ()
 
 sortArraysByKeyCheckIfSortingIsCorrectDataProvider ()
 
 sortArraysByKeyCheckIfSortingIsCorrect (array $array, $key, $ascending, $expectedResult)
 
 sortArraysByKeyThrowsExceptionForNonExistingKey ()
 
 arrayExportReturnsFormattedMultidimensionalArray ()
 
 arrayExportThrowsExceptionIfObjectShouldBeExported ()
 
 arrayExportReturnsNumericArrayKeys ()
 
 arrayExportReturnsNoKeyIndexForConsecutiveCountedArrays ()
 
 arrayExportReturnsKeyIndexForNonConsecutiveCountedArrays ()
 
array flattenCalculatesExpectedResultDataProvider ()
 
 flattenCalculatesExpectedResult (array $array, array $expected)
 
array flattenPlainCalculatesExpectedResultDataProvider ()
 
 flattenPlainCalculatesExpectedResult (array $array, array $expected)
 
array flattenWithKeepDotsCalculatesExpectedResultDataProvider ()
 
 flattenWithKeepDotsCalculatesExpectedResult (array $array, array $expected)
 
array intersectRecursiveCalculatesExpectedResultDataProvider ()
 
 intersectRecursiveCalculatesExpectedResult (array $source, array $mask, array $expected)
 
array renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider ()
 
 renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder (array $inputArray, array $expected)
 
array mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider ()
 
 mergeRecursiveWithOverruleCalculatesExpectedResult ($input1, $input2, $addKeys, $includeEmptyValues, $enableUnsetFeature, $expected)
 
 checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntriesFromMultiDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntryWithEmptyString ()
 
 keepItemsInArrayWorksWithOneArgument ($search, $array, $expected)
 
array keepItemsInArrayWorksWithOneArgumentDataProvider ()
 
 keepItemsInArrayCanUseClosure ()
 
 remapArrayKeysExchangesKeysWithGivenMapping ()
 
 arrayDiffKeyRecursiveHandlesOneDimensionalArrays ()
 
 arrayDiffKeyRecursiveHandlesMultiDimensionalArrays ()
 
 arrayDiffKeyRecursiveHandlesMixedArrays ()
 
 arrayDiffKeyRecursiveReturnsEmptyIfEqual ()
 
 arrayDiffAssocRecursiveHandlesOneDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMultiDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMixedArrays ()
 
 arrayDiffAssocRecursiveReturnsEmptyIfEqual ()
 
 naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder ()
 
 naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder ()
 
array filterAndSortByNumericKeysWithAcceptAnyKey ()
 
 filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue ($input, $expected)
 
array filterAndSortByNumericKeysWithoutAcceptAnyKey ()
 
 filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse ($input, $expected)
 
array sortArrayWithIntegerKeysDataProvider ()
 
 sortArrayWithIntegerKeysSortsNumericArrays (array $arrayToSort, array $expectedArray)
 
 assertAllArrayKeysAreValidThrowsExceptionOnNotAllowedArrayKeys ()
 
 assertAllArrayKeysAreValidReturnsNullOnAllowedArrayKeys ()
 
 sortArrayWithIntegerKeysRecursiveExpectSorting ()
 
 sortArrayWithIntegerKeysRecursiveExpectNoSorting ()
 
 reIndexNumericArrayKeysRecursiveExpectReindexing ()
 
 reIndexNumericArrayKeysRecursiveExpectNoReindexing ()
 
 removeNullValuesRecursiveExpectRemoval ()
 
 stripTagsFromValuesRecursiveExpectRemoval ()
 
 stripTagsFromValuesRecursiveExpectNoTypeCast ()
 
 convertBooleanStringsToBooleanRecursiveExpectConverting ()
 
array filterRecursiveFiltersFalseElementsDataProvider ()
 
 filterRecursiveFiltersFalseElements (array $input, array $expectedResult)
 
array filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider ()
 
 filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback (array $input, array $expectedResult)
 
array filterRecursiveSupportsCallableCallbackDataProvider ()
 
 filterRecursiveSupportsCallableCallback (array $input, array $expectedResult, callable $callback)
 
array isAssociativeCorrectlyFindsStringKeysDataProvider ()
 
 isAssociativeCorrectlyFindsStringKeys (array $array, bool $expectedResult)
 
array replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider ()
 
 replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays (array $array1, array $array2, array $expectedResult)
 

Detailed Description

Test case

Definition at line 28 of file ArrayUtilityTest.php.

Member Function Documentation

◆ arrayDiffAssocRecursiveHandlesMixedArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffAssocRecursiveHandlesMixedArrays ( )

◆ arrayDiffAssocRecursiveHandlesMultiDimensionalArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffAssocRecursiveHandlesMultiDimensionalArrays ( )

◆ arrayDiffAssocRecursiveHandlesOneDimensionalArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffAssocRecursiveHandlesOneDimensionalArrays ( )

◆ arrayDiffAssocRecursiveReturnsEmptyIfEqual()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffAssocRecursiveReturnsEmptyIfEqual ( )

◆ arrayDiffKeyRecursiveHandlesMixedArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffKeyRecursiveHandlesMixedArrays ( )

◆ arrayDiffKeyRecursiveHandlesMultiDimensionalArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffKeyRecursiveHandlesMultiDimensionalArrays ( )

◆ arrayDiffKeyRecursiveHandlesOneDimensionalArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffKeyRecursiveHandlesOneDimensionalArrays ( )

◆ arrayDiffKeyRecursiveReturnsEmptyIfEqual()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayDiffKeyRecursiveReturnsEmptyIfEqual ( )

◆ arrayExportReturnsFormattedMultidimensionalArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayExportReturnsFormattedMultidimensionalArray ( )

◆ arrayExportReturnsKeyIndexForNonConsecutiveCountedArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayExportReturnsKeyIndexForNonConsecutiveCountedArrays ( )

◆ arrayExportReturnsNoKeyIndexForConsecutiveCountedArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayExportReturnsNoKeyIndexForConsecutiveCountedArrays ( )

◆ arrayExportReturnsNumericArrayKeys()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayExportReturnsNumericArrayKeys ( )

◆ arrayExportThrowsExceptionIfObjectShouldBeExported()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::arrayExportThrowsExceptionIfObjectShouldBeExported ( )

◆ assertAllArrayKeysAreValidReturnsNullOnAllowedArrayKeys()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::assertAllArrayKeysAreValidReturnsNullOnAllowedArrayKeys ( )

◆ assertAllArrayKeysAreValidThrowsExceptionOnNotAllowedArrayKeys()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::assertAllArrayKeysAreValidThrowsExceptionOnNotAllowedArrayKeys ( )

◆ checkRemoveArrayEntryByValueRemovesEntriesFromMultiDimensionalArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::checkRemoveArrayEntryByValueRemovesEntriesFromMultiDimensionalArray ( )

◆ checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray ( )

◆ checkRemoveArrayEntryByValueRemovesEntryWithEmptyString()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::checkRemoveArrayEntryByValueRemovesEntryWithEmptyString ( )

◆ convertBooleanStringsToBooleanRecursiveExpectConverting()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::convertBooleanStringsToBooleanRecursiveExpectConverting ( )

◆ filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse (   $input,
  $expected 
)
Test:
‪@dataProvider filterAndSortByNumericKeysWithoutAcceptAnyKey
Parameters
array$input
array$expected

Definition at line 2907 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterAndSortByNumericKeys().

◆ filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue (   $input,
  $expected 
)
Test:
‪@dataProvider filterAndSortByNumericKeysWithAcceptAnyKey
Parameters
array$input
array$expected

Definition at line 2841 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterAndSortByNumericKeys().

◆ filterAndSortByNumericKeysWithAcceptAnyKey()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysWithAcceptAnyKey ( )

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue

Returns
‪array

Definition at line 2755 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithoutAcceptAnyKey()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysWithoutAcceptAnyKey ( )

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse

Returns
‪array

Definition at line 2852 of file ArrayUtilityTest.php.

◆ filterByValueRecursive()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterByValueRecursive ( )

Data provider for filterByValueRecursiveCorrectlyFiltersArray

Every array splits into:

  • String value to search for
  • ‪Input array
  • ‪Expected result array

Definition at line 41 of file ArrayUtilityTest.php.

◆ filterByValueRecursiveCorrectlyFiltersArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterByValueRecursiveCorrectlyFiltersArray (   $needle,
  $haystack,
  $expectedResult 
)
Test:
‪@dataProvider filterByValueRecursive
Parameters
array$needle
array$haystack
array$expectedResult

Definition at line 170 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterByValueRecursive().

◆ filterByValueRecursiveDoesNotMatchDifferentInstancesOfSameClass()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterByValueRecursiveDoesNotMatchDifferentInstancesOfSameClass ( )

◆ filterByValueRecursiveMatchesReferencesToSameObject()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterByValueRecursiveMatchesReferencesToSameObject ( )

◆ filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback ( array  $input,
array  $expectedResult 
)
Test:
‪@dataProvider filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider
Parameters
array$input
array$expectedResult

Definition at line 3385 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterRecursive().

◆ filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider ( )

Data provider for filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback

Returns
‪array

Definition at line 3316 of file ArrayUtilityTest.php.

◆ filterRecursiveFiltersFalseElements()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveFiltersFalseElements ( array  $input,
array  $expectedResult 
)
Test:
‪@dataProvider filterRecursiveFiltersFalseElementsDataProvider
Parameters
array$input
array$expectedResult

Definition at line 3305 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterRecursive().

◆ filterRecursiveFiltersFalseElementsDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveFiltersFalseElementsDataProvider ( )

Data provider for arrayFilterRecursiveFiltersFalseElements

Returns
‪array

Definition at line 3239 of file ArrayUtilityTest.php.

◆ filterRecursiveSupportsCallableCallback()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveSupportsCallableCallback ( array  $input,
array  $expectedResult,
callable  $callback 
)
Test:
‪@dataProvider filterRecursiveSupportsCallableCallbackDataProvider
Parameters
array$input
array$expectedResult
callable$callback
See also
https://forge.typo3.org/issues/84485

Definition at line 3452 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\filterRecursive().

◆ filterRecursiveSupportsCallableCallbackDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveSupportsCallableCallbackDataProvider ( )

Data provider for filterRecursiveSupportsCallableCallback

Returns
‪array

Definition at line 3401 of file ArrayUtilityTest.php.

◆ flattenCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenCalculatesExpectedResult ( array  $array,
array  $expected 
)
Test:
Parameters
array$array
array$expected‪@dataProvider flattenCalculatesExpectedResultDataProvider

Definition at line 1363 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\flatten().

◆ flattenCalculatesExpectedResultDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenCalculatesExpectedResultDataProvider ( )
Returns
‪array

Definition at line 1267 of file ArrayUtilityTest.php.

◆ flattenPlainCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenPlainCalculatesExpectedResult ( array  $array,
array  $expected 
)
Test:
Parameters
array$array
array$expected‪@dataProvider flattenPlainCalculatesExpectedResultDataProvider

Definition at line 1539 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\flattenPlain().

◆ flattenPlainCalculatesExpectedResultDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenPlainCalculatesExpectedResultDataProvider ( )
Returns
‪array

Definition at line 1375 of file ArrayUtilityTest.php.

◆ flattenWithKeepDotsCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenWithKeepDotsCalculatesExpectedResult ( array  $array,
array  $expected 
)
Test:
Parameters
array$array
array$expected‪@dataProvider flattenWithKeepDotsCalculatesExpectedResultDataProvider

Definition at line 1661 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\flatten().

◆ flattenWithKeepDotsCalculatesExpectedResultDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenWithKeepDotsCalculatesExpectedResultDataProvider ( )
Returns
‪array

Definition at line 1547 of file ArrayUtilityTest.php.

◆ getValueByPathAcceptsDifferentDelimiter()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathAcceptsDifferentDelimiter ( )

◆ getValueByPathGetsCorrectValue()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathGetsCorrectValue ( array  $array,
  $path,
  $expectedResult 
)
Test:
‪@dataProvider getValueByPathValidDataProvider
Parameters
array$array
string$path
mixed$expectedResult

Definition at line 469 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath().

◆ getValueByPathInvalidPathDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathInvalidPathDataProvider ( )

Data provider for getValueByPathThrowsExceptionIfPathNotExists Every array splits into:

  • ‪Array to get value from
  • String path
  • ‪Expected result
    Returns
    ‪array

Definition at line 269 of file ArrayUtilityTest.php.

◆ getValueByPathReturnsFirstIndexIfPathIsZero()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathReturnsFirstIndexIfPathIsZero ( )

◆ getValueByPathReturnsFirstIndexIfPathSegmentIsZero()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathReturnsFirstIndexIfPathSegmentIsZero ( )

◆ getValueByPathThrowsExceptionIfPathIsEmpty()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsExceptionIfPathIsEmpty ( )

◆ getValueByPathThrowsExceptionIfPathIsNotString()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsExceptionIfPathIsNotString ( )

◆ getValueByPathThrowsExceptionIfPathNotExists()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsExceptionIfPathNotExists ( array  $array,
  $path 
)
Test:
‪@dataProvider getValueByPathInvalidPathDataProvider
Parameters
array$array
string$path

Definition at line 336 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath().

◆ getValueByPathThrowsSpecificExceptionIfPathNotExists()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsSpecificExceptionIfPathNotExists ( array  $array,
string  $path 
)
Test:
‪@dataProvider getValueByPathInvalidPathDataProvider
Parameters
array$array
string$path

Definition at line 349 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath().

◆ getValueByPathValidDataProvider()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathValidDataProvider ( )

Data provider for getValueByPathReturnsCorrectValue Every array splits into:

  • ‪Array to get value from
  • String path
  • ‪Expected result

Definition at line 363 of file ArrayUtilityTest.php.

◆ intersectRecursiveCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::intersectRecursiveCalculatesExpectedResult ( array  $source,
array  $mask,
array  $expected 
)
Test:
Parameters
array$source
array$mask
array$expected‪@dataProvider intersectRecursiveCalculatesExpectedResultDataProvider

Definition at line 1874 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\intersectRecursive().

◆ intersectRecursiveCalculatesExpectedResultDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::intersectRecursiveCalculatesExpectedResultDataProvider ( )
Returns
‪array

Definition at line 1673 of file ArrayUtilityTest.php.

◆ isAssociativeCorrectlyFindsStringKeys()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::isAssociativeCorrectlyFindsStringKeys ( array  $array,
bool  $expectedResult 
)
Test:
‪@dataProvider isAssociativeCorrectlyFindsStringKeysDataProvider
Parameters
array$array
bool$expectedResult

Definition at line 3497 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\isAssociative().

◆ isAssociativeCorrectlyFindsStringKeysDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::isAssociativeCorrectlyFindsStringKeysDataProvider ( )

Data provider for isAssociativeCorrectlyFindsStringKeys

Returns
‪array

Definition at line 3462 of file ArrayUtilityTest.php.

◆ isValidPathReturnsFalseIfPathDoesNotExist()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::isValidPathReturnsFalseIfPathDoesNotExist ( )

◆ isValidPathReturnsTrueIfPathExists()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::isValidPathReturnsTrueIfPathExists ( )

◆ keepItemsInArrayCanUseClosure()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::keepItemsInArrayCanUseClosure ( )

Shows the example from the doc comment where a function is used to reduce the sub arrays to one item which is then used for the matching.

Test:

Definition at line 2377 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\keepItemsInArray().

◆ keepItemsInArrayWorksWithOneArgument()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::keepItemsInArrayWorksWithOneArgument (   $search,
  $array,
  $expected 
)
Test:
‪@dataProvider keepItemsInArrayWorksWithOneArgumentDataProvider
Parameters
mixed$search‪The items which are allowed/kept in the array
array$array‪target array
array$expected‪expected array

Definition at line 2343 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\keepItemsInArray().

◆ keepItemsInArrayWorksWithOneArgumentDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::keepItemsInArrayWorksWithOneArgumentDataProvider ( )

Data provider for keepItemsInArrayWorksWithOneArgument

Returns
‪array

Definition at line 2353 of file ArrayUtilityTest.php.

◆ mergeRecursiveWithOverruleCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::mergeRecursiveWithOverruleCalculatesExpectedResult (   $input1,
  $input2,
  $addKeys,
  $includeEmptyValues,
  $enableUnsetFeature,
  $expected 
)
Test:
‪@dataProvider mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider
Parameters
array$input1‪Input 1
array$input2‪Input 2
bool$addKeys‪TRUE if should add keys, else FALSE
bool$includeEmptyValues‪TRUE if should include empty values, else FALSE
bool$enableUnsetFeature‪TRUE if should enable unset feature, else FALSE
array$expected‪expected array

Definition at line 2264 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

◆ mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider ( )
Returns
‪array

Definition at line 2019 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder ( )

◆ naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder ( )

◆ reIndexNumericArrayKeysRecursiveExpectNoReindexing()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::reIndexNumericArrayKeysRecursiveExpectNoReindexing ( )

◆ reIndexNumericArrayKeysRecursiveExpectReindexing()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::reIndexNumericArrayKeysRecursiveExpectReindexing ( )

◆ remapArrayKeysExchangesKeysWithGivenMapping()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::remapArrayKeysExchangesKeysWithGivenMapping ( )

◆ removeByPathAcceptsGivenDelimiter()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathAcceptsGivenDelimiter ( )

◆ removeByPathRemovesCorrectPath()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathRemovesCorrectPath ( array  $array,
  $path,
  $expectedResult 
)
Test:
‪@dataProvider removeByPathRemovesCorrectPathDataProvider
Parameters
array$array
string$path
array$expectedResult

Definition at line 952 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\removeByPath().

◆ removeByPathRemovesCorrectPathDataProvider()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathRemovesCorrectPathDataProvider ( )

Data provider for removeByPathRemovesCorrectPath

Definition at line 900 of file ArrayUtilityTest.php.

◆ removeByPathRemovesFirstIndexWithZeroAsPath()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathRemovesFirstIndexWithZeroAsPath ( )

◆ removeByPathRemovesFirstIndexWithZeroAsPathSegment()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathRemovesFirstIndexWithZeroAsPathSegment ( )

◆ removeByPathThrowsExceptionIfPathDoesNotExistInArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathThrowsExceptionIfPathDoesNotExistInArray ( )

◆ removeByPathThrowsExceptionIfPathIsEmpty()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathThrowsExceptionIfPathIsEmpty ( )

◆ removeByPathThrowsExceptionIfPathIsNotAString()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathThrowsExceptionIfPathIsNotAString ( )

◆ removeByPathThrowsExceptionWithEmptyPathSegment()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathThrowsExceptionWithEmptyPathSegment ( )

◆ removeByPathThrowsSpecificExceptionIfPathDoesNotExistInArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathThrowsSpecificExceptionIfPathDoesNotExistInArray ( )

◆ removeNullValuesRecursiveExpectRemoval()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeNullValuesRecursiveExpectRemoval ( )

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider ( )
Returns
‪array

Definition at line 1885 of file ArrayUtilityTest.php.

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder ( array  $inputArray,
array  $expected 
)
Test:
Parameters
array$inputArray
array$expected‪@dataProvider renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider

Definition at line 2011 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\renumberKeysToAvoidLeapsIfKeysAreAllNumeric().

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays ( array  $array1,
array  $array2,
array  $expectedResult 
)
Test:
‪@dataProvider replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider
Parameters
array$array1
array$array2
array$expectedResult

Definition at line 3586 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\replaceAndAppendScalarValuesRecursive().

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider ( )

Data provider for replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays

Returns
‪array

Definition at line 3507 of file ArrayUtilityTest.php.

◆ setValueByPathCanUseZeroAsPath()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathCanUseZeroAsPath ( )

◆ setValueByPathCanUseZeroAsPathSegment()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathCanUseZeroAsPathSegment ( )

◆ setValueByPathSetsCorrectValue()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathSetsCorrectValue ( array  $array,
  $path,
  $value,
  $expectedResult 
)
Test:
‪@dataProvider setValueByPathSetsCorrectValueDataProvider
Parameters
array$array
string$path
string$value
array$expectedResult

Definition at line 767 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\setValueByPath().

◆ setValueByPathSetsCorrectValueDataProvider()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathSetsCorrectValueDataProvider ( )

Data provider for setValueByPathSetsCorrectValueDataProvider

Every array splits into:

  • ‪Array to set value in
  • String path
  • ‪Value to set
  • ‪Expected result

Definition at line 557 of file ArrayUtilityTest.php.

◆ setValueByPathThrowsExceptionIfPathIsEmpty()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathThrowsExceptionIfPathIsEmpty ( )

◆ setValueByPathThrowsExceptionIfPathIsNotAString()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathThrowsExceptionIfPathIsNotAString ( )

◆ setValueByPathThrowsExceptionIfPathSegmentIsEmpty()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::setValueByPathThrowsExceptionIfPathSegmentIsEmpty ( )

◆ sortArraysByKeyCheckIfSortingIsCorrect()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArraysByKeyCheckIfSortingIsCorrect ( array  $array,
  $key,
  $ascending,
  $expectedResult 
)
Test:
‪@dataProvider sortArraysByKeyCheckIfSortingIsCorrectDataProvider
Parameters
array$array
string$key
bool$ascending
array$expectedResult

Definition at line 1125 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\sortArraysByKey().

◆ sortArraysByKeyCheckIfSortingIsCorrectDataProvider()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArraysByKeyCheckIfSortingIsCorrectDataProvider ( )

Data provider for sortArraysByKeyCheckIfSortingIsCorrect

Definition at line 997 of file ArrayUtilityTest.php.

◆ sortArraysByKeyThrowsExceptionForNonExistingKey()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArraysByKeyThrowsExceptionForNonExistingKey ( )

◆ sortArrayWithIntegerKeysDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArrayWithIntegerKeysDataProvider ( )

dataProvider for sortArrayWithIntegerKeys

Returns
‪array

Definition at line 2918 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysRecursiveExpectNoSorting()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArrayWithIntegerKeysRecursiveExpectNoSorting ( )

◆ sortArrayWithIntegerKeysRecursiveExpectSorting()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArrayWithIntegerKeysRecursiveExpectSorting ( )

◆ sortArrayWithIntegerKeysSortsNumericArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArrayWithIntegerKeysSortsNumericArrays ( array  $arrayToSort,
array  $expectedArray 
)
Test:
Parameters
array$arrayToSort
array$expectedArray‪@dataProvider sortArrayWithIntegerKeysDataProvider

Definition at line 2968 of file ArrayUtilityTest.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\sortArrayWithIntegerKeys().

◆ sortByKeyRecursiveCheckIfSortingIsCorrect()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortByKeyRecursiveCheckIfSortingIsCorrect ( )

◆ stripTagsFromValuesRecursiveExpectNoTypeCast()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::stripTagsFromValuesRecursiveExpectNoTypeCast ( )

◆ stripTagsFromValuesRecursiveExpectRemoval()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::stripTagsFromValuesRecursiveExpectRemoval ( )