TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest:
TYPO3\CMS\Core\Tests\UnitTestCase TYPO3\CMS\Core\Tests\BaseTestCase

Public Member Functions

 filterByValueRecursive ()
 
 filterByValueRecursiveCorrectlyFiltersArray ($needle, $haystack, $expectedResult)
 
 filterByValueRecursiveMatchesReferencesToSameObject ()
 
 filterByValueRecursiveDoesNotMatchDifferentInstancesOfSameClass ()
 
 isValidPathReturnsTrueIfPathExists ()
 
 isValidPathReturnsFalseIfPathDoesNotExist ()
 
 getValueByPathThrowsExceptionIfPathIsNotString ()
 
 getValueByPathThrowsExceptionIfPathIsEmpty ()
 
 getValueByPathReturnsFirstIndexIfPathIsZero ()
 
 getValueByPathReturnsFirstIndexIfPathSegmentIsZero ()
 
 getValueByPathInvalidPathDataProvider ()
 
 getValueByPathThrowsExceptionIfPathNotExists (array $array, $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 ()
 
 removeByPathAcceptsGivenDelimiter ()
 
 removeByPathRemovesCorrectPathDataProvider ()
 
 removeByPathRemovesCorrectPath (array $array, $path, $expectedResult)
 
 sortByKeyRecursiveCheckIfSortingIsCorrect ()
 
 sortArraysByKeyCheckIfSortingIsCorrectDataProvider ()
 
 sortArraysByKeyCheckIfSortingIsCorrect (array $array, $key, $ascending, $expectedResult)
 
 sortArraysByKeyThrowsExceptionForNonExistingKey ()
 
 arrayExportReturnsFormattedMultidimensionalArray ()
 
 arrayExportThrowsExceptionIfObjectShouldBeExported ()
 
 arrayExportReturnsNumericArrayKeys ()
 
 arrayExportReturnsNoKeyIndexForConsecutiveCountedArrays ()
 
 arrayExportReturnsKeyIndexForNonConsecutiveCountedArrays ()
 
 flattenCalculatesExpectedResultDataProvider ()
 
 flattenCalculatesExpectedResult (array $array, array $expected)
 
 intersectRecursiveCalculatesExpectedResultDataProvider ()
 
 intersectRecursiveCalculatesExpectedResult (array $source, array $mask, array $expected)
 
 renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider ()
 
 renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder (array $inputArray, array $expected)
 
 mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider ()
 
 mergeRecursiveWithOverruleCalculatesExpectedResult ($input1, $input2, $addKeys, $includeEmptyValues, $enableUnsetFeature, $expected)
 
 inArrayChecksStringExistenceWithinArray ($array, $item, $expected)
 
 inArrayDataProvider ()
 
 checkRemoveArrayEntryByValueRemovesEntriesFromOneDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntriesFromMultiDimensionalArray ()
 
 checkRemoveArrayEntryByValueRemovesEntryWithEmptyString ()
 
 keepItemsInArrayWorksWithOneArgument ($search, $array, $expected)
 
 keepItemsInArrayWorksWithOneArgumentDataProvider ()
 
 keepItemsInArrayCanUseClosure ()
 
 remapArrayKeysExchangesKeysWithGivenMapping ()
 
 arrayDiffAssocRecursiveHandlesOneDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMultiDimensionalArrays ()
 
 arrayDiffAssocRecursiveHandlesMixedArrays ()
 
 arrayDiffAssocRecursiveReturnsEmptyIfEqual ()
 
 naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder ()
 
 naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder ()
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 getAccessibleMock ( $originalClassName, $methods=[], array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)
 
 getAccessibleMockForAbstractClass ( $originalClassName, array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[])
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix='')
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Test case

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

◆ 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 ( )
Test:
1342294987

Definition at line 1085 of file ArrayUtilityTest.php.

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

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

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

◆ filterByValueRecursiveCorrectlyFiltersArray()

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

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

◆ flattenCalculatesExpectedResult()

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

Definition at line 1257 of file ArrayUtilityTest.php.

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

◆ flattenCalculatesExpectedResultDataProvider()

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

Definition at line 1161 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:
getValueByPathValidDataProvider
Parameters
array$array
string$path
mixed$expectedResult

Definition at line 432 of file ArrayUtilityTest.php.

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

◆ getValueByPathInvalidPathDataProvider()

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 267 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 ( )
Test:
1341397767

Definition at line 238 of file ArrayUtilityTest.php.

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

◆ getValueByPathThrowsExceptionIfPathIsNotString()

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

Definition at line 228 of file ArrayUtilityTest.php.

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

◆ getValueByPathThrowsExceptionIfPathNotExists()

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

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

◆ inArrayChecksStringExistenceWithinArray()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::inArrayChecksStringExistenceWithinArray (   $array,
  $item,
  $expected 
)
Test:
inArrayDataProvider
Parameters
array$arraytarget array
string$itemsearch string
bool$expectedexpected value

Definition at line 1872 of file ArrayUtilityTest.php.

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

◆ inArrayDataProvider()

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

Data provider for inArrayChecksStringExistenceWithinArray

Returns
array

Definition at line 1882 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$expectedintersectRecursiveCalculatesExpectedResultDataProvider

Definition at line 1470 of file ArrayUtilityTest.php.

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

◆ intersectRecursiveCalculatesExpectedResultDataProvider()

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

Definition at line 1269 of file ArrayUtilityTest.php.

◆ isValidPathReturnsFalseIfPathDoesNotExist()

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

◆ isValidPathReturnsTrueIfPathExists()

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

Mock the class under test, isValidPath() (method under test), calls static getValuePath() internally, which is mocked here to return a specific result. This works because of 'static' keyword' instead of 'self' for getValueByPath() call, using late static binding in PHP 5.3

Test:

Definition at line 207 of file ArrayUtilityTest.php.

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

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

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

◆ keepItemsInArrayWorksWithOneArgument()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::keepItemsInArrayWorksWithOneArgument (   $search,
  $array,
  $expected 
)
Test:
keepItemsInArrayWorksWithOneArgumentDataProvider
Parameters
mixed$searchThe items which are allowed/kept in the array
array$arraytarget array
array$expectedexpected array

Definition at line 1969 of file ArrayUtilityTest.php.

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

◆ keepItemsInArrayWorksWithOneArgumentDataProvider()

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

Data provider for keepItemsInArrayWorksWithOneArgument

Returns
array

Definition at line 1979 of file ArrayUtilityTest.php.

◆ mergeRecursiveWithOverruleCalculatesExpectedResult()

TYPO3\CMS\Core\Tests\Unit\Utility\ArrayUtilityTest::mergeRecursiveWithOverruleCalculatesExpectedResult (   $input1,
  $input2,
  $addKeys,
  $includeEmptyValues,
  $enableUnsetFeature,
  $expected 
)
Test:
mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider
Parameters
array$input1Input 1
array$input2Input 2
bool$addKeysTRUE if should add keys, else FALSE
bool$includeEmptyValuesTRUE if should include empty values, else FALSE
bool$enableUnsetFeatureTRUE if should enable unset feature, else FALSE
array$expectedexpected array

Definition at line 1856 of file ArrayUtilityTest.php.

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

◆ mergeRecursiveWithOverruleCalculatesExpectedResultDataProvider()

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

Definition at line 1611 of file ArrayUtilityTest.php.

◆ naturalKeySortRecursiveSortsMultiDimensionalArrayByNaturalOrder()

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

◆ naturalKeySortRecursiveSortsOneDimensionalArrayByNaturalOrder()

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

◆ 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:
removeByPathRemovesCorrectPathDataProvider
Parameters
array$array
string$path
array$expectedResult

Definition at line 849 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 797 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 ( )
Test:
1371758436

Definition at line 761 of file ArrayUtilityTest.php.

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

◆ removeByPathThrowsExceptionIfPathIsEmpty()

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

Definition at line 705 of file ArrayUtilityTest.php.

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

◆ removeByPathThrowsExceptionIfPathIsNotAString()

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

Definition at line 715 of file ArrayUtilityTest.php.

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

◆ removeByPathThrowsExceptionWithEmptyPathSegment()

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

Definition at line 725 of file ArrayUtilityTest.php.

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

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericDataProvider()

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

Definition at line 1481 of file ArrayUtilityTest.php.

◆ renumberKeysToAvoidLeapsIfKeysAreAllNumericReturnsExpectedOrder()

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

Definition at line 1603 of file ArrayUtilityTest.php.

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

◆ 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:
setValueByPathSetsCorrectValueDataProvider
Parameters
array$array
string$path
string$value
array$expectedResult

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

◆ setValueByPathThrowsExceptionIfPathIsEmpty()

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

Definition at line 467 of file ArrayUtilityTest.php.

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

◆ setValueByPathThrowsExceptionIfPathIsNotAString()

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

Definition at line 477 of file ArrayUtilityTest.php.

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

◆ setValueByPathThrowsExceptionIfPathSegmentIsEmpty()

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

Definition at line 487 of file ArrayUtilityTest.php.

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

◆ sortArraysByKeyCheckIfSortingIsCorrect()

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

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

◆ sortArraysByKeyThrowsExceptionForNonExistingKey()

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

Definition at line 1033 of file ArrayUtilityTest.php.

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

◆ sortByKeyRecursiveCheckIfSortingIsCorrect()

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