‪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 28 of file ArrayUtilityTest.php.

Member Function Documentation

◆ arrayDiffAssocRecursiveHandlesMixedArrays()

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

Definition at line 2725 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveHandlesMultiDimensionalArrays()

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

Definition at line 2687 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveHandlesOneDimensionalArrays()

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

Definition at line 2666 of file ArrayUtilityTest.php.

◆ arrayDiffAssocRecursiveReturnsEmptyIfEqual()

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

Definition at line 2752 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesMixedArrays()

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

Definition at line 2611 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesMultiDimensionalArrays()

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

Definition at line 2574 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveHandlesOneDimensionalArrays()

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

Definition at line 2553 of file ArrayUtilityTest.php.

◆ arrayDiffKeyRecursiveReturnsEmptyIfEqual()

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

Definition at line 2637 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 ( )
Test:

Definition at line 2423 of file ArrayUtilityTest.php.

◆ checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray()

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

Definition at line 2403 of file ArrayUtilityTest.php.

◆ checkRemoveArrayEntryByValueRemovesEntryWithEmptyString()

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

Definition at line 2444 of file ArrayUtilityTest.php.

◆ 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 3028 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue()

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

Definition at line 2964 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithAcceptAnyKey()

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

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsTrue

Definition at line 2878 of file ArrayUtilityTest.php.

◆ filterAndSortByNumericKeysWithoutAcceptAnyKey()

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

Data provider for filterAndSortByNumericKeysBehavesCorrectlyForAcceptAnyKeysIsFalse

Definition at line 2973 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 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

Definition at line 3495 of file ArrayUtilityTest.php.

◆ filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerZeroByCallbackDataProvider()

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

Data provider for filterRecursiveCallbackFiltersEmptyElementsWithoutIntegerByCallback

Definition at line 3428 of file ArrayUtilityTest.php.

◆ filterRecursiveFiltersFalseElements()

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

Definition at line 3418 of file ArrayUtilityTest.php.

◆ filterRecursiveFiltersFalseElementsDataProvider()

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

Data provider for arrayFilterRecursiveFiltersFalseElements

Definition at line 3355 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
0 | ARRAY_FILTER_USE_KEY | ARRAY_FILTER_USE_BOTH$mode

Definition at line 3572 of file ArrayUtilityTest.php.

◆ filterRecursiveSupportsCallableCallbackDataProvider()

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

Data provider for filterRecursiveSupportsCallableCallback

Definition at line 3510 of file ArrayUtilityTest.php.

◆ flattenCalculatesExpectedResult()

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

Definition at line 1358 of file ArrayUtilityTest.php.

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

◆ flattenCalculatesExpectedResultDataProvider()

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

Definition at line 1236 of file ArrayUtilityTest.php.

◆ flattenPlainCalculatesExpectedResult()

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

Definition at line 1525 of file ArrayUtilityTest.php.

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

◆ flattenPlainCalculatesExpectedResultDataProvider()

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

Definition at line 1363 of file ArrayUtilityTest.php.

◆ flattenWithKeepDotsCalculatesExpectedResult()

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

Definition at line 1642 of file ArrayUtilityTest.php.

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

◆ flattenWithKeepDotsCalculatesExpectedResultDataProvider()

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

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

Definition at line 470 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 274 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 
)
Test:
‪@dataProvider getValueByPathInvalidPathDataProvider
Parameters
string$path

Definition at line 340 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

Definition at line 351 of file ArrayUtilityTest.php.

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

◆ 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 365 of file ArrayUtilityTest.php.

◆ intersectRecursiveCalculatesExpectedResult()

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

Definition at line 2012 of file ArrayUtilityTest.php.

◆ intersectRecursiveCalculatesExpectedResultDataProvider()

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

Definition at line 1814 of file ArrayUtilityTest.php.

◆ isAssociativeCorrectlyFindsStringKeys()

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

Definition at line 3614 of file ArrayUtilityTest.php.

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

◆ isAssociativeCorrectlyFindsStringKeysDataProvider()

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

Data provider for isAssociativeCorrectlyFindsStringKeys

Definition at line 3581 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.

Test:

Definition at line 2502 of file ArrayUtilityTest.php.

◆ 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 2470 of file ArrayUtilityTest.php.

◆ keepItemsInArrayWorksWithOneArgumentDataProvider()

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

Data provider for keepItemsInArrayWorksWithOneArgument

Definition at line 2478 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 2391 of file ArrayUtilityTest.php.

◆ mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider()

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

Definition at line 2146 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder()

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

Definition at line 2817 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder()

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

Definition at line 2782 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 ( )
Test:

Definition at line 2527 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 
)
Test:
‪@dataProvider removeByPathRemovesCorrectPathDataProvider
Parameters
string$path
array$expectedResult

Definition at line 929 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 878 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 2017 of file ArrayUtilityTest.php.

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder()

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

Definition at line 2141 of file ArrayUtilityTest.php.

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays()

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

Definition at line 3699 of file ArrayUtilityTest.php.

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

◆ replaceAndAppendScalarValuesRecursiveCorrectlyMergesArraysDataProvider()

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

Data provider for replaceAndAppendScalarValuesRecursiveCorrectlyMergesArrays

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

Definition at line 756 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 547 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 
)
Test:
‪@dataProvider sortArraysByKeyCheckIfSortingIsCorrectDataProvider
Parameters
string$key
bool$ascending
array$expectedResult

Definition at line 1101 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 974 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 3037 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysRecursiveExpectNoSorting()

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

Definition at line 3166 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysRecursiveExpectSorting()

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

Definition at line 3136 of file ArrayUtilityTest.php.

◆ sortArrayWithIntegerKeysSortsNumericArrays()

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

@dataProvider sortArrayWithIntegerKeysDataProvider

Definition at line 3085 of file ArrayUtilityTest.php.

◆ sortByKeyRecursiveCheckIfSortingIsCorrect()

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

◆ stripTagsFromValuesRecursiveExpectNoTypeCast()

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

Definition at line 3295 of file ArrayUtilityTest.php.

◆ stripTagsFromValuesRecursiveExpectRemoval()

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

Definition at line 3271 of file ArrayUtilityTest.php.

◆ unflattenCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::unflattenCalculatesExpectedResult ( array  $array,
array  $expected 
)
Test:
‪@dataProvider unflattenCalculatesExpectedResultDataProvider

Definition at line 1809 of file ArrayUtilityTest.php.

◆ unflattenCalculatesExpectedResultDataProvider()

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

Definition at line 1647 of file ArrayUtilityTest.php.