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

Public Member Functions

 filterByValueRecursiveCorrectlyFiltersArray ($needle, $haystack, $expectedResult)
 
 filterByValueRecursiveMatchesReferencesToSameObject ()
 
 filterByValueRecursiveDoesNotMatchDifferentInstancesOfSameClass ()
 
 isValidPathReturnsTrueIfPathExistsStringVersion ()
 
 isValidPathReturnsFalseIfPathDoesNotExistStringVersion ()
 
 isValidPathReturnsTrueIfPathExistsArrayVersion ()
 
 isValidPathReturnsFalseIfPathDoesNotExistArrayVersion ()
 
 getValueByPathThrowsExceptionIfPathIsEmpty ()
 
 getValueByPathReturnsFirstIndexIfPathIsZero ()
 
 getValueByPathReturnsFirstIndexIfPathSegmentIsZero ()
 
 getValueByPathThrowsExceptionIfPathNotExists (array $array, $path)
 
 getValueByPathThrowsSpecificExceptionIfPathNotExists (array $array, string $path)
 
 getValueByPathGetsCorrectValue (array $array, $path, $expectedResult)
 
 getValueByPathAcceptsDifferentDelimiter ()
 
 setValueByPathThrowsExceptionIfPathIsEmpty ()
 
 setValueByPathThrowsExceptionIfPathSegmentIsEmpty ()
 
 setValueByPathCanUseZeroAsPathSegment ()
 
 setValueByPathCanUseZeroAsPath ()
 
 setValueByPathSetsCorrectValue (array $array, $path, $value, $expectedResult)
 
 removeByPathThrowsExceptionIfPathIsEmpty ()
 
 removeByPathThrowsExceptionWithEmptyPathSegment ()
 
 removeByPathRemovesFirstIndexWithZeroAsPathSegment ()
 
 removeByPathRemovesFirstIndexWithZeroAsPath ()
 
 removeByPathThrowsExceptionIfPathDoesNotExistInArray ()
 
 removeByPathThrowsSpecificExceptionIfPathDoesNotExistInArray ()
 
 removeByPathAcceptsGivenDelimiter ()
 
 removeByPathRemovesCorrectPath (array $array, $path, $expectedResult)
 
 sortByKeyRecursiveCheckIfSortingIsCorrect ()
 
 sortArraysByKeyCheckIfSortingIsCorrect (array $array, $key, $ascending, $expectedResult)
 
 sortArraysByKeyThrowsExceptionForNonExistingKey ()
 
 arrayExportReturnsFormattedMultidimensionalArray ()
 
 arrayExportThrowsExceptionIfObjectShouldBeExported ()
 
 arrayExportReturnsNumericArrayKeys ()
 
 arrayExportReturnsNoKeyIndexForConsecutiveCountedArrays ()
 
 arrayExportReturnsKeyIndexForNonConsecutiveCountedArrays ()
 
 flattenCalculatesExpectedResult (array $array, array $expected)
 
 flattenPlainCalculatesExpectedResult (array $array, array $expected)
 
 flattenWithKeepDotsCalculatesExpectedResult (array $array, array $expected)
 
 unflattenCalculatesExpectedResult (array $array, array $expected)
 
 intersectRecursiveCalculatesExpectedResult (array $source, array $mask, array $expected)
 
 renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder (array $inputArray, array $expected)
 
 mergeRecursiveWithOverruleCalculatesExpectedResult ($input1, $input2, $addKeys, $includeEmptyValues, $enableUnsetFeature, $expected)
 
 checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntriesFromMultiDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntryWithEmptyString ()
 
 keepItemsInArrayWorksWithOneArgument ($search, $array, $expected)
 
 keepItemsInArrayCanUseClosure ()
 
 remapArrayKeysExchangesKeysWithGivenMapping ()
 
 arrayDiffKeyRecursiveHandlesOneDimensionalArrays ()
 
 arrayDiffKeyRecursiveHandlesMultiDimensionalArrays ()
 
 arrayDiffKeyRecursiveHandlesMixedArrays ()
 
 arrayDiffKeyRecursiveReturnsEmptyIfEqual ()
 
 arrayDiffAssocRecursiveHandlesOneDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMultiDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMixedArrays ()
 
 arrayDiffAssocRecursiveReturnsEmptyIfEqual ()
 
 naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder ()
 
 naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder ()
 
 filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue ($input, $expected)
 
 filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse ($input, $expected)
 
 sortArrayWithIntegerKeysSortsNumericArrays (array $arrayToSort, array $expectedArray)
 
 assertAllArrayKeysAreValidThrowsExceptionOnNotAllowedArrayKeys ()
 
 assertAllArrayKeysAreValidReturnsNullOnAllowedArrayKeys ()
 
 sortArrayWithIntegerKeysRecursiveExpectSorting ()
 
 sortArrayWithIntegerKeysRecursiveExpectNoSorting ()
 
 reIndexNumericArrayKeysRecursiveExpectReindexing ()
 
 reIndexNumericArrayKeysRecursiveExpectNoReindexing ()
 
 removeNullValuesRecursiveExpectRemoval ()
 
 stripTagsFromValuesRecursiveExpectRemoval ()
 
 stripTagsFromValuesRecursiveExpectNoTypeCast ()
 
 convertBooleanStringsToBooleanRecursiveExpectConverting ()
 
 filterRecursiveFiltersFalseElements (array $input, array $expectedResult)
 
 filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback (array $input, array $expectedResult)
 
 filterRecursiveSupportsCallableCallback (array $input, array $expectedResult, callable $callback, int $mode=0)
 
 isAssociativeCorrectlyFindsStringKeys (array $array, bool $expectedResult)
 
 replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays (array $array1, array $array2, array $expectedResult)
 

Static Public Member Functions

static filterByValueRecursive ()
 
static getValueByPathInvalidPathDataProvider ()
 
static getValueByPathValidDataProvider ()
 
static setValueByPathSetsCorrectValueDataProvider ()
 
static removeByPathRemovesCorrectPathDataProvider ()
 
static sortArraysByKeyCheckIfSortingIsCorrectDataProvider ()
 
static flattenCalculatesExpectedResultDataProvider ()
 
static flattenPlainCalculatesExpectedResultDataProvider ()
 
static flattenWithKeepDotsCalculatesExpectedResultDataProvider ()
 
static unflattenCalculatesExpectedResultDataProvider ()
 
static intersectRecursiveCalculatesExpectedResultDataProvider ()
 
static renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider ()
 
static mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider ()
 
static keepItemsInArrayWorksWithOneArgumentDataProvider ()
 
static filterAndSortByNumericKeysWithAcceptAnyKey ()
 
static filterAndSortByNumericKeysWithoutAcceptAnyKey ()
 
static sortArrayWithIntegerKeysDataProvider ()
 
static filterRecursiveFiltersFalseElementsDataProvider ()
 
static filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider ()
 
static filterRecursiveSupportsCallableCallbackDataProvider ()
 
static isAssociativeCorrectlyFindsStringKeysDataProvider ()
 
static replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider ()
 

Detailed Description

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

Definition at line 30 of file ArrayUtilityTest.php.

Member Function Documentation

◆ arrayDiffAssocRecursiveHandlesMixedArrays()

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

Definition at line 2632 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveHandlesMultiDimensionalArrays()

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

Definition at line 2596 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveHandlesOneDimensionalArrays()

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

Definition at line 2577 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveReturnsEmptyIfEqual()

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

Definition at line 2657 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesMixedArrays()

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

Definition at line 2526 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesMultiDimensionalArrays()

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

Definition at line 2491 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesOneDimensionalArrays()

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

Definition at line 2472 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveReturnsEmptyIfEqual()

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

Definition at line 2550 of file ArrayUtilityTest.php.

◆ 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 ( )

Definition at line 2349 of file ArrayUtilityTest.php.

◆ checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray()

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

Definition at line 2331 of file ArrayUtilityTest.php.

◆ checkRemoveArrayEntryByValueRemovesEntryWithEmptyString()

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

Definition at line 2368 of file ArrayUtilityTest.php.

◆ convertBooleanStringsToBooleanRecursiveExpectConverting()

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

◆ filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse (   $input,
  $expected 
)
Parameters
array$input
array$expected

Definition at line 2926 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue (   $input,
  $expected 
)
Parameters
array$input
array$expected

Definition at line 2863 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithAcceptAnyKey()

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

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue

Definition at line 2778 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithoutAcceptAnyKey()

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

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse

Definition at line 2872 of file ArrayUtilityTest.php.

◆ filterByValueRecursive()

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

Data provider for filterByValueRecursiveCorrectlyFiltersArray

Every array splits into:

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

Definition at line 43 of file ArrayUtilityTest.php.

◆ filterByValueRecursiveCorrectlyFiltersArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterByValueRecursiveCorrectlyFiltersArray (   $needle,
  $haystack,
  $expectedResult 
)
Parameters
array$needle
array$haystack
array$expectedResult

Definition at line 172 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 
)

Definition at line 3365 of file ArrayUtilityTest.php.

◆ filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider()

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

Data provider for filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback

Definition at line 3300 of file ArrayUtilityTest.php.

◆ filterRecursiveFiltersFalseElements()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::filterRecursiveFiltersFalseElements ( array  $input,
array  $expectedResult 
)

Definition at line 3290 of file ArrayUtilityTest.php.

◆ filterRecursiveFiltersFalseElementsDataProvider()

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

Data provider for arrayFilterRecursiveFiltersFalseElements

Definition at line 3229 of file ArrayUtilityTest.php.

◆ filterRecursiveSupportsCallableCallback()

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

Definition at line 3442 of file ArrayUtilityTest.php.

◆ filterRecursiveSupportsCallableCallbackDataProvider()

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

Data provider for filterRecursiveSupportsCallableCallback

Definition at line 3380 of file ArrayUtilityTest.php.

◆ flattenCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenCalculatesExpectedResult ( array  $array,
array  $expected 
)

◆ flattenCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenCalculatesExpectedResultDataProvider ( )
static

Definition at line 1178 of file ArrayUtilityTest.php.

◆ flattenPlainCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenPlainCalculatesExpectedResult ( array  $array,
array  $expected 
)

◆ flattenPlainCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenPlainCalculatesExpectedResultDataProvider ( )
static

Definition at line 1303 of file ArrayUtilityTest.php.

◆ flattenWithKeepDotsCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenWithKeepDotsCalculatesExpectedResult ( array  $array,
array  $expected 
)

◆ flattenWithKeepDotsCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::flattenWithKeepDotsCalculatesExpectedResultDataProvider ( )
static

Definition at line 1468 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 
)
Parameters
string$path
mixed$expectedResult

Definition at line 451 of file ArrayUtilityTest.php.

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

◆ getValueByPathInvalidPathDataProvider()

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

Data provider for getValueByPathThrowsExceptionIfPathNotExists Every array splits into:

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

Definition at line 257 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 ( )

◆ getValueByPathThrowsExceptionIfPathNotExists()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsExceptionIfPathNotExists ( array  $array,
  $path 
)
Parameters
string$path

Definition at line 323 of file ArrayUtilityTest.php.

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

◆ getValueByPathThrowsSpecificExceptionIfPathNotExists()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::getValueByPathThrowsSpecificExceptionIfPathNotExists ( array  $array,
string  $path 
)

◆ getValueByPathValidDataProvider()

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

Data provider for getValueByPathReturnsCorrectValue Every array splits into:

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

Definition at line 346 of file ArrayUtilityTest.php.

◆ intersectRecursiveCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::intersectRecursiveCalculatesExpectedResult ( array  $source,
array  $mask,
array  $expected 
)

Definition at line 1944 of file ArrayUtilityTest.php.

◆ intersectRecursiveCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::intersectRecursiveCalculatesExpectedResultDataProvider ( )
static

Definition at line 1748 of file ArrayUtilityTest.php.

◆ isAssociativeCorrectlyFindsStringKeys()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::isAssociativeCorrectlyFindsStringKeys ( array  $array,
bool  $expectedResult 
)

◆ isAssociativeCorrectlyFindsStringKeysDataProvider()

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

Data provider for isAssociativeCorrectlyFindsStringKeys

Definition at line 3451 of file ArrayUtilityTest.php.

◆ isValidPathReturnsFalseIfPathDoesNotExistArrayVersion()

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

◆ isValidPathReturnsFalseIfPathDoesNotExistStringVersion()

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

◆ isValidPathReturnsTrueIfPathExistsArrayVersion()

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

◆ isValidPathReturnsTrueIfPathExistsStringVersion()

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

◆ 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.

Definition at line 2425 of file ArrayUtilityTest.php.

◆ keepItemsInArrayWorksWithOneArgument()

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

Definition at line 2394 of file ArrayUtilityTest.php.

◆ keepItemsInArrayWorksWithOneArgumentDataProvider()

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

Data provider for keepItemsInArrayWorksWithOneArgument

Definition at line 2402 of file ArrayUtilityTest.php.

◆ mergeRecursiveWithOverruleCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::mergeRecursiveWithOverruleCalculatesExpectedResult (   $input1,
  $input2,
  $addKeys,
  $includeEmptyValues,
  $enableUnsetFeature,
  $expected 
)
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 2321 of file ArrayUtilityTest.php.

◆ mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider ( )
static

Definition at line 2076 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder()

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

Definition at line 2717 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder()

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

Definition at line 2684 of file ArrayUtilityTest.php.

◆ 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 ( )

Definition at line 2448 of file ArrayUtilityTest.php.

◆ removeByPathAcceptsGivenDelimiter()

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

◆ removeByPathRemovesCorrectPath()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::removeByPathRemovesCorrectPath ( array  $array,
  $path,
  $expectedResult 
)
Parameters
string$path
array$expectedResult

Definition at line 885 of file ArrayUtilityTest.php.

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

◆ removeByPathRemovesCorrectPathDataProvider()

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

Data provider for removeByPathRemovesCorrectPath

Definition at line 834 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 ( )

◆ 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()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider ( )
static

Definition at line 1949 of file ArrayUtilityTest.php.

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder ( array  $inputArray,
array  $expected 
)

Definition at line 2071 of file ArrayUtilityTest.php.

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays ( array  $array1,
array  $array2,
array  $expectedResult 
)

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider()

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

Data provider for replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays

Definition at line 3491 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 
)
Parameters
string$path
string$value
array$expectedResult

Definition at line 727 of file ArrayUtilityTest.php.

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

◆ setValueByPathSetsCorrectValueDataProvider()

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

Data provider for setValueByPathSetsCorrectValueDataProvider

Every array splits into:

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

Definition at line 518 of file ArrayUtilityTest.php.

◆ setValueByPathThrowsExceptionIfPathIsEmpty()

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

◆ setValueByPathThrowsExceptionIfPathSegmentIsEmpty()

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

◆ sortArraysByKeyCheckIfSortingIsCorrect()

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

Definition at line 1055 of file ArrayUtilityTest.php.

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

◆ sortArraysByKeyCheckIfSortingIsCorrectDataProvider()

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

Data provider for sortArraysByKeyCheckIfSortingIsCorrect

Definition at line 928 of file ArrayUtilityTest.php.

◆ sortArraysByKeyThrowsExceptionForNonExistingKey()

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

◆ sortArrayWithIntegerKeysDataProvider()

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

dataProvider for sortArrayWithIntegerKeys

Definition at line 2935 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysRecursiveExpectNoSorting()

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

Definition at line 3052 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysRecursiveExpectSorting()

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

Definition at line 3024 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysSortsNumericArrays()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::sortArrayWithIntegerKeysSortsNumericArrays ( array  $arrayToSort,
array  $expectedArray 
)

Definition at line 2979 of file ArrayUtilityTest.php.

◆ sortByKeyRecursiveCheckIfSortingIsCorrect()

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

◆ stripTagsFromValuesRecursiveExpectNoTypeCast()

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

Definition at line 3171 of file ArrayUtilityTest.php.

◆ stripTagsFromValuesRecursiveExpectRemoval()

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

Definition at line 3149 of file ArrayUtilityTest.php.

◆ unflattenCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::unflattenCalculatesExpectedResult ( array  $array,
array  $expected 
)

Definition at line 1743 of file ArrayUtilityTest.php.

◆ unflattenCalculatesExpectedResultDataProvider()

static TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::unflattenCalculatesExpectedResultDataProvider ( )
static

Definition at line 1583 of file ArrayUtilityTest.php.