‪TYPO3CMS  11.5
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, int $mode=0)
 
array isAssociativeCorrectlyFindsStringKeysDataProvider ()
 
 isAssociativeCorrectlyFindsStringKeys (array $array, bool $expectedResult)
 
array replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider ()
 
 replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays (array $array1, array $array2, array $expectedResult)
 

Detailed Description

Test case

Todo:
‪When further defining the method parameter types test bench errors occur

Definition at line 29 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 2908 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 2842 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 2756 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithoutAcceptAnyKey()

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

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse

Returns
‪array

Definition at line 2853 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 42 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 171 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 3240 of file ArrayUtilityTest.php.

◆ filterRecursiveSupportsCallableCallback()

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

Definition at line 3466 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 1364 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 1268 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 1540 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 1376 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 1662 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 1548 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 470 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 270 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 337 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 350 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 364 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 1875 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 1674 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 3511 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 3476 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 2378 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 2344 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 2354 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 2265 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 2020 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 953 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 901 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 1886 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 2012 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 3600 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 3521 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 768 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 558 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 1126 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 998 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 2919 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 2969 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 ( )