TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
GeneralUtilityTest Class Reference
Inheritance diagram for GeneralUtilityTest:
UnitTestCase BaseTestCase

Public Member Functions

 isConnected ()
 
 canRetrieveValueWithGP ($key, $get, $post, $expected)
 
 gpDataProvider ()
 
 gpMergedWillMergeArraysFromGetAndPost ($get, $post, $expected)
 
 gpMergedDataProvider ()
 
 getAndPostDataProvider ()
 
 canRetrieveGlobalInputsThroughGet ($key, $get, $expected)
 
 canRetrieveGlobalInputsThroughPost ($key, $post, $expected)
 
 canSetNewGetInputValues ($input, $key, $expected, $getPreset=[])
 
 getSetDataProvider ()
 
 cmpIPv4ReturnsTrueForMatchingAddress ($ip, $list)
 
 cmpIPv4ReturnsFalseForNotMatchingAddress ($ip, $list)
 
 cmpIPv6ReturnsTrueForMatchingAddress ($ip, $list)
 
 cmpIPv6ReturnsFalseForNotMatchingAddress ($ip, $list)
 
 IPv6Hex2BinCorrectlyConvertsAddresses ($hex, $binary)
 
 IPv6Bin2HexCorrectlyConvertsAddresses ($binary, $hex)
 
 normalizeIPv6CorrectlyNormalizesAddresses ($compressed, $normalized)
 
 compressIPv6CorrectlyCompressesAdresses ($compressed, $normalized)
 
 compressIPv6CorrectlyCompressesAdressWithSomeAddressOnRightSide ()
 
 validIpReturnsTrueForValidIp ($ip)
 
 validIpReturnsFalseForInvalidIp ($ip)
 
 cmpFqdnReturnsTrue ($baseHost, $list)
 
 cmpFqdnReturnsFalse ($baseHost, $list)
 
 inListForItemContainedReturnsTrue ($haystack)
 
 inListForItemContainedReturnsTrueDataProvider ()
 
 inListForItemNotContainedReturnsFalse ($haystack)
 
 inListForItemNotContainedReturnsFalseDataProvider ()
 
 rmFromListRemovesElementsFromCommaSeparatedList ($initialList, $listWithElementRemoved)
 
 rmFromListRemovesElementsFromCommaSeparatedListDataProvider ()
 
 expandListExpandsIntegerRanges ($list, $expectation)
 
 expandListExpandsIntegerRangesDataProvider ()
 
 expandListExpandsForTwoThousandElementsExpandsOnlyToThousandElementsMaximum ()
 
 uniqueListUnifiesCommaSeparatedList ($initialList, $unifiedList)
 
 uniqueListUnifiesCommaSeparatedListDataProvider ()
 
 isFirstPartOfStrReturnsTrueForMatchingFirstPartDataProvider ()
 
 isFirstPartOfStrReturnsTrueForMatchingFirstPart ($string, $part)
 
 isFirstPartOfStrReturnsFalseForNotMatchingFirstPartDataProvider ()
 
 isFirstPartOfStrReturnsFalseForNotMatchingFirstPart ($string, $part)
 
 formatSizeTranslatesBytesToHigherOrderRepresentation ($size, $labels, $base, $expected)
 
 formatSizeDataProvider ()
 
 splitCalcDataProvider ()
 
 splitCalcCorrectlySplitsExpression ($expected, $expression)
 
 htmlspecialcharsDecodeReturnsDecodedString ()
 
 deHSCentitiesReturnsDecodedString ($input, $expected)
 
 deHSCentitiesReturnsDecodedStringDataProvider ()
 
 slashJsEscapesSingleQuotesAndSlashes ($input, $extended, $expected)
 
 slashJsDataProvider ()
 
 rawUrlEncodeJsPreservesWhitespaces ()
 
 rawUrlEncodeFpPreservesSlashes ()
 
 strtouppperDataProvider ()
 
 strtoupperConvertsOnlyLatinCharacters ($input, $expected)
 
 strtolowerConvertsOnlyLatinCharacters ($expected, $input)
 
 validEmailValidDataProvider ()
 
 validEmailReturnsTrueForValidMailAddress ($address)
 
 validEmailInvalidDataProvider ()
 
 validEmailReturnsFalseForInvalidMailAddress ($address)
 
 intExplodeConvertsStringsToInteger ()
 
 implodeArrayForUrlDataProvider ()
 
 implodeArrayForUrlBuildsValidParameterString ($name, $input, $expected)
 
 implodeArrayForUrlCanSkipEmptyParameters ()
 
 implodeArrayForUrlCanUrlEncodeKeyNames ()
 
 explodeUrl2ArrayTransformsParameterStringToNestedArray ($name, $array, $input)
 
 explodeUrl2ArrayTransformsParameterStringToFlatArray ($input, $expected)
 
 explodeUrl2ArrayDataProvider ()
 
 compileSelectedGetVarsFromArrayFiltersIncomingData ()
 
 compileSelectedGetVarsFromArrayUsesGetPostDataFallback ()
 
 revExplodeDataProvider ()
 
 revExplodeCorrectlyExplodesStringForGivenPartsCount ($delimiter, $testString, $count, $expectedArray)
 
 revExplodeRespectsLimitThreeWhenExploding ()
 
 trimExplodeReturnsCorrectResult ($delimiter, $testString, $removeEmpty, $limit, $expectedResult)
 
 trimExplodeReturnsCorrectResultDataProvider ()
 
 getBytesFromSizeMeasurementDataProvider ()
 
 getBytesFromSizeMeasurementCalculatesCorrectByteValue ($expected, $byteString)
 
 getIndpEnvTypo3SitePathReturnNonEmptyString ()
 
 getIndpEnvTypo3SitePathReturnsStringStartingWithSlash ()
 
 getIndpEnvTypo3SitePathReturnsStringStartingWithDrive ()
 
 getIndpEnvTypo3SitePathReturnsStringEndingWithSlash ()
 
 getIndpEnvTypo3HostOnlyParsesHostnamesAndIpAdresses ($httpHost, $expectedIp)
 
 isAllowedHostHeaderValueReturnsFalseIfTrusedHostsIsNotConfigured ()
 
 isAllowedHostHeaderValueReturnsTrueIfHostValueMatches ($httpHost, $hostNamePattern)
 
 isAllowedHostHeaderValueReturnsFalseIfHostValueMatches ($httpHost, $hostNamePattern)
 
 serverNamePatternDataProvider ()
 
 isAllowedHostHeaderValueWorksCorrectlyWithWithServerNamePattern ($httpHost, $serverName, $isAllowed, $serverPort= '80', $ssl= 'Off')
 
 allGetIndpEnvCallsRelatedToHostNamesCallIsAllowedHostHeaderValue ()
 
 getIndpEnvForHostThrowsExceptionForNotAllowedHostnameValues ($httpHost, $hostNamePattern)
 
 getIndpEnvForHostAllowsAllHostnameValuesIfHostPatternIsSetToAllowAll ($httpHost, $hostNamePattern)
 
 getIndpEnvTypo3PortParsesHostnamesAndIpAdresses ($httpHost, $dummy, $expectedPort)
 
 underscoredToUpperCamelCaseDataProvider ()
 
 underscoredToUpperCamelCase ($expected, $inputString)
 
 underscoredToLowerCamelCaseDataProvider ()
 
 underscoredToLowerCamelCase ($expected, $inputString)
 
 camelCaseToLowerCaseUnderscoredDataProvider ()
 
 camelCaseToLowerCaseUnderscored ($expected, $inputString)
 
 lcfirstDataProvider ()
 
 lcFirst ($expected, $inputString)
 
 validUrlValidResourceDataProvider ()
 
 validURLReturnsTrueForValidResource ($url)
 
 isValidUrlInvalidRessourceDataProvider ()
 
 validURLReturnsFalseForInvalidRessoure ($url)
 
 isOnCurrentHostReturnsTrueWithCurrentHost ()
 
 checkisOnCurrentHostInvalidHosts ()
 
 sanitizeLocalUrlValidPathsDataProvider ()
 
 sanitizeLocalUrlAcceptsNotEncodedValidPaths ($path)
 
 sanitizeLocalUrlAcceptsEncodedValidPaths ($path)
 
 sanitizeLocalUrlValidUrlsDataProvider ()
 
 sanitizeLocalUrlAcceptsNotEncodedValidUrls ($url, $host, $subDirectory)
 
 sanitizeLocalUrlAcceptsEncodedValidUrls ($url, $host, $subDirectory)
 
 sanitizeLocalUrlInvalidDataProvider ()
 
 sanitizeLocalUrlDeniesPlainInvalidUrls ($url)
 
 sanitizeLocalUrlDeniesEncodedInvalidUrls ($url)
 
 unlink_tempfileRemovesValidFileInTypo3temp ()
 
 unlink_tempfileRemovesHiddenFile ()
 
 unlink_tempfileReturnsTrueIfFileWasRemoved ()
 
 unlink_tempfileReturnsNullIfFileDoesNotExist ()
 
 unlink_tempfileReturnsNullIfFileIsNowWithinTypo3temp ()
 
 tempnamReturnsPathStartingWithGivenPrefix ()
 
 tempnamReturnsPathWithoutBackslashes ()
 
 tempnamReturnsAbsolutePathInsideDocumentRoot ()
 
 removeDotsFromTypoScriptSucceedsWithDottedArray ()
 
 removeDotsFromTypoScriptOverridesSubArray ()
 
 removeDotsFromTypoScriptOverridesWithScalar ()
 
 getDirsReturnsArrayOfDirectoriesFromGivenDirectory ()
 
 getDirsReturnsStringErrorOnPathFailure ()
 
 hmacReturnsHashOfProperLength ()
 
 hmacReturnsEqualHashesForEqualInput ()
 
 hmacReturnsNoEqualHashesForNonEqualInput ()
 
 quoteJsValueDataProvider ()
 
 quoteJsValueTest ($input, $expected)
 
 getSetWritesArrayToGetSystemVariable ()
 
 getSetWritesArrayToGlobalsHttpGetVars ()
 
 getSetForArrayDropsExistingValues ()
 
 getSetAssignsOneValueToOneKey ()
 
 getSetForOneValueDoesNotDropUnrelatedValues ()
 
 getSetCanAssignsAnArrayToASpecificArrayElement ()
 
 getSetCanAssignAStringValueToASpecificArrayChildElement ()
 
 getSetCanAssignAnArrayToASpecificArrayChildElement ()
 
 minifyJavaScriptReturnsInputStringIfNoHookIsRegistered ()
 
 minifyJavaScriptCallsRegisteredHookWithInputString ()
 
 isMinifyJavaScriptHookCalledCallback (array $params)
 
 minifyJavaScriptReturnsErrorStringOfHookException ()
 
 minifyJavaScriptWritesExceptionMessageToDevLog ()
 
 minifyJavaScriptErroneousCallback ()
 
 fixPermissionsSetsGroup ()
 
 fixPermissionsSetsPermissionsToFile ()
 
 fixPermissionsSetsPermissionsToHiddenFile ()
 
 fixPermissionsSetsPermissionsToDirectory ()
 
 fixPermissionsSetsPermissionsToDirectoryWithTrailingSlash ()
 
 fixPermissionsSetsPermissionsToHiddenDirectory ()
 
 fixPermissionsCorrectlySetsPermissionsRecursive ()
 
 fixPermissionsDoesNotSetPermissionsToNotAllowedPath ()
 
 fixPermissionsSetsPermissionsWithRelativeFileReference ()
 
 fixPermissionsSetsDefaultPermissionsToFile ()
 
 fixPermissionsSetsDefaultPermissionsToDirectory ()
 
 mkdirCreatesDirectory ()
 
 mkdirCreatesHiddenDirectory ()
 
 mkdirCreatesDirectoryWithTrailingSlash ()
 
 mkdirSetsPermissionsOfCreatedDirectory ()
 
 mkdirSetsGroupOwnershipOfCreatedDirectory ()
 
 mkdirDeepCreatesDirectory ()
 
 mkdirDeepCreatesSubdirectoriesRecursive ()
 
 mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider ()
 
 mkdirDeepCreatesDirectoryWithDoubleSlashes ($directoryToCreate)
 
 mkdirDeepFixesPermissionsOfCreatedDirectory ()
 
 mkdirDeepFixesPermissionsOnNewParentDirectory ()
 
 mkdirDeepDoesNotChangePermissionsOfExistingSubDirectories ()
 
 mkdirDeepSetsGroupOwnershipOfCreatedDirectory ()
 
 mkdirDeepSetsGroupOwnershipOfCreatedParentDirectory ()
 
 mkdirDeepSetsGroupOwnershipOnNewSubDirectory ()
 
 mkdirDeepCreatesDirectoryInVfsStream ()
 
 mkdirDeepThrowsExceptionIfDirectoryCreationFails ()
 
 mkdirDeepThrowsExceptionIfBaseDirectoryIsNotOfTypeString ()
 
 mkdirDeepThrowsExceptionIfDeepDirectoryIsNotOfTypeString ()
 
 rmdirRemovesFile ()
 
 rmdirReturnTrueIfFileWasRemoved ()
 
 rmdirReturnFalseIfNoFileWasRemoved ()
 
 rmdirRemovesDirectory ()
 
 rmdirRemovesDirectoryWithTrailingSlash ()
 
 rmdirDoesNotRemoveDirectoryWithFilesAndReturnsFalseIfRecursiveDeletionIsOff ()
 
 rmdirRemovesDirectoriesRecursiveAndReturnsTrue ()
 
 rmdirRemovesLinkToDirectory ()
 
 rmdirRemovesDeadLinkToDirectory ()
 
 rmdirRemovesDeadLinkToFile ()
 
 getFilesInDirFindsRegularFile ()
 
 getFilesInDirFindsHiddenFile ()
 
 getFilesInDirByExtensionFindsFiles ()
 
 getFilesInDirByExtensionDoesNotFindFilesWithOtherExtensions ()
 
 getFilesInDirExcludesFilesMatchingPattern ()
 
 getFilesInDirCanPrependPath ()
 
 getFilesInDirDoesSortAlphabeticallyByDefault ()
 
 getFilesInDirCanOrderByMtime ()
 
 getFilesInDirReturnsArrayWithMd5OfElementAndPathAsArrayKey ()
 
 getFilesInDirDoesNotFindDirectories ()
 
 getFilesInDirDoesNotFindDotfiles ()
 
 imageMagickCommandsDataProvider ()
 
 explodeAndUnquoteImageMagickCommands ($source, $expectedQuoted, $expectedUnquoted)
 
 splitFileRefReturnsFileTypeNotForFolders ()
 
 splitFileRefReturnsFileTypeForFilesWithoutPathSite ()
 
 dirnameDataProvider ()
 
 dirnameWithDataProvider ($input, $expectedValue)
 
 resolveBackPathDataProvider ()
 
 resolveBackPathWithDataProvider ($input, $expectedValue)
 
 makeInstanceWithEmptyClassNameThrowsException ()
 
 makeInstanceWithNullClassNameThrowsException ()
 
 makeInstanceWithZeroStringClassNameThrowsException ()
 
 makeInstanceWithEmptyArrayThrowsException ()
 
 makeInstanceWithNonEmptyArrayThrowsException ()
 
 makeInstanceWithBeginningSlashInClassNameThrowsException ()
 
 makeInstanceReturnsClassInstance ()
 
 makeInstancePassesParametersToConstructor ()
 
 makeInstanceInstanciatesConfiguredImplementation ()
 
 makeInstanceResolvesConfiguredImplementationsRecursively ()
 
 makeInstanceCalledTwoTimesForNonSingletonClassReturnsDifferentInstances ()
 
 makeInstanceCalledTwoTimesForSingletonClassReturnsSameInstance ()
 
 makeInstanceCalledTwoTimesForSingletonClassWithPurgeInstancesInbetweenReturnsDifferentInstances ()
 
 setSingletonInstanceForEmptyClassNameThrowsException ()
 
 setSingletonInstanceForClassThatIsNoSubclassOfProvidedClassThrowsException ()
 
 setSingletonInstanceMakesMakeInstanceReturnThatInstance ()
 
 setSingletonInstanceCalledTwoTimesMakesMakeInstanceReturnLastSetInstance ()
 
 getSingletonInstancesContainsPreviouslySetSingletonInstance ()
 
 resetSingletonInstancesResetsPreviouslySetInstance ()
 
 resetSingletonInstancesSetsGivenInstance ()
 
 addInstanceForEmptyClassNameThrowsException ()
 
 addInstanceForClassThatIsNoSubclassOfProvidedClassThrowsException ()
 
 addInstanceWithSingletonInstanceThrowsException ()
 
 addInstanceMakesMakeInstanceReturnThatInstance ()
 
 makeInstanceCalledTwoTimesAfterAddInstanceReturnTwoDifferentInstances ()
 
 addInstanceCalledTwoTimesMakesMakeInstanceReturnBothInstancesInAddingOrder ()
 
 purgeInstancesDropsAddedInstance ()
 
 getFileAbsFileNameDateprovider ()
 
 validPathStrInvalidCharactersDataProvider ()
 
 validPathStrDetectsInvalidCharacters ($path)
 
 validPathStrDataProvider ()
 
 validPathStrWorksWithUnicodeFileNames ($path)
 
 deniedFilesDataProvider ()
 
 verifyFilenameAgainstDenyPatternDetectsNotAllowedFiles ($deniedFile)
 
 copyDirectoryCopiesFilesAndDirectoriesWithRelativePaths ()
 
 copyDirectoryCopiesFilesAndDirectoriesWithAbsolutePaths ()
 
 syslogFixesPermissionsOnFileIfUsingFileLogging ()
 
 deprecationLogFixesPermissionsOnLogFile ()
 
 callUserFunctionWillReturnFalseForInvalidParameters ($functionName)
 
 callUserFunctionWillThrowExceptionForInvalidParameters ($functionName, $expectedException)
 
 callUserFunctionInvalidParameterDataprovider ()
 
 callUserFunctionCanCallFunction ()
 
 callUserFunctionCanCallMethod ()
 
 user_calledUserFunction ()
 
 callUserFunctionCanPrefixFuncNameWithFilePath ()
 
 callUserFunctionCanPersistObjectsBetweenCalls ()
 
 user_calledUserFunctionCountCallers (&$params)
 
 callUserFunctionAcceptsClosures ()
 
 callUserFunctionTrimsSpaces ()
 
 getAllFilesAndFoldersInPathReturnsArrayWithMd5Keys ()
 
 xml2ArrayConvertsEmptyArraysToElementWithoutContent ()
 
 providerForXml2Array ()
 
 xml2ArrayDealsProperlyWithWhitespace (string $input)
 
 idnaEncodeConvertsUnicodeCharsToASCIIString ($actual, $expected)
 
 idnaEncodeDataProvider ()
 

Static Public Member Functions

static cmpIPv4DataProviderMatching ()
 
static cmpIPv4DataProviderNotMatching ()
 
static cmpIPv6DataProviderMatching ()
 
static cmpIPv6DataProviderNotMatching ()
 
static IPv6Hex2BinDataProviderCorrect ()
 
static IPv6Bin2HexDataProviderCorrect ()
 
static normalizeCompressIPv6DataProviderCorrect ()
 
static validIpDataProvider ()
 
static invalidIpDataProvider ()
 
static cmpFqdnValidDataProvider ()
 
static cmpFqdnInvalidDataProvider ()
 
static hostnameAndPortDataProvider ()
 
static hostnamesMatchingTrustedHostsConfigurationDataProvider ()
 
static hostnamesNotMatchingTrustedHostsConfigurationDataProvider ()
 

Public Attributes

const NO_FIX_PERMISSIONS_ON_WINDOWS = 'fixPermissions() not available on Windows (method does nothing)'
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 getVirtualTestDir ($prefix= 'root_')
 
 getFilesInDirCreateTestDirectory ()
 
- Protected Member Functions inherited from UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from 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,...$arguments)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix= '')
 

Protected Attributes

 $singletonInstances = []
 
 $backupPackageManager
 
- Protected Attributes inherited from UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Private Member Functions

 checkGroups ($methodName)
 

Detailed Description

Testcase for class

Definition at line 37 of file GeneralUtilityTest.php.

Member Function Documentation

addInstanceCalledTwoTimesMakesMakeInstanceReturnBothInstancesInAddingOrder ( )
addInstanceForClassThatIsNoSubclassOfProvidedClassThrowsException ( )
Test:

Definition at line 4163 of file GeneralUtilityTest.php.

References GeneralUtility\addInstance().

addInstanceForEmptyClassNameThrowsException ( )
Test:

Definition at line 4151 of file GeneralUtilityTest.php.

References GeneralUtility\addInstance().

addInstanceMakesMakeInstanceReturnThatInstance ( )
addInstanceWithSingletonInstanceThrowsException ( )
Test:

Definition at line 4178 of file GeneralUtilityTest.php.

References GeneralUtility\addInstance().

allGetIndpEnvCallsRelatedToHostNamesCallIsAllowedHostHeaderValue ( )
callUserFunctionAcceptsClosures ( )
Test:

Definition at line 4607 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionCanCallFunction ( )

Above tests already showed that the prefix is checked properly, therefore this test skips the prefix and enables to inline the instantly created function (who's name doesn't have a prefix).

Test:

Definition at line 4544 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionCanCallMethod ( )
Test:

Definition at line 4556 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionCanPersistObjectsBetweenCalls ( )
Test:

Definition at line 4584 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionCanPrefixFuncNameWithFilePath ( )
Test:

Definition at line 4574 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionInvalidParameterDataprovider ( )

Data provider for callUserFunctionInvalidParameterDataprovider and callUserFunctionWillThrowExceptionForInvalidParameters.

Returns
array

Definition at line 4526 of file GeneralUtilityTest.php.

callUserFunctionTrimsSpaces ( )
Test:

Definition at line 4620 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionWillReturnFalseForInvalidParameters (   $functionName)
Test:
callUserFunctionInvalidParameterDataprovider

Definition at line 4495 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

callUserFunctionWillThrowExceptionForInvalidParameters (   $functionName,
  $expectedException 
)
Test:
callUserFunctionInvalidParameterDataprovider
Parameters
string$functionName
int$expectedException

Definition at line 4511 of file GeneralUtilityTest.php.

References GeneralUtility\callUserFunction().

camelCaseToLowerCaseUnderscored (   $expected,
  $inputString 
)
Test:
camelCaseToLowerCaseUnderscoredDataProvider

Definition at line 1954 of file GeneralUtilityTest.php.

References GeneralUtility\camelCaseToLowerCaseUnderscored().

camelCaseToLowerCaseUnderscoredDataProvider ( )

Data provider for camelCaseToLowerCaseUnderscored

Returns
array expected, input string

Definition at line 1940 of file GeneralUtilityTest.php.

canRetrieveGlobalInputsThroughGet (   $key,
  $get,
  $expected 
)
Test:
getAndPostDataProvider

Definition at line 199 of file GeneralUtilityTest.php.

References GeneralUtility\_GET().

canRetrieveGlobalInputsThroughPost (   $key,
  $post,
  $expected 
)
Test:
getAndPostDataProvider

Definition at line 209 of file GeneralUtilityTest.php.

References GeneralUtility\_POST().

canRetrieveValueWithGP (   $key,
  $get,
  $post,
  $expected 
)
Test:
gpDataProvider

Definition at line 112 of file GeneralUtilityTest.php.

References GeneralUtility\_GP().

canSetNewGetInputValues (   $input,
  $key,
  $expected,
  $getPreset = [] 
)
Test:
getSetDataProvider

Definition at line 222 of file GeneralUtilityTest.php.

References GeneralUtility\_GETset().

checkGroups (   $methodName)
private

Check if test on filesystem group ownership can be done in this environment If so, return second group of webserver user

Parameters
string$methodNamecalling method name
Returns
mixed FALSE if test cannot be run, int group id of the second group of webserver user

Definition at line 3073 of file GeneralUtilityTest.php.

Referenced by GeneralUtilityTest\mkdirDeepSetsGroupOwnershipOfCreatedDirectory(), GeneralUtilityTest\mkdirDeepSetsGroupOwnershipOfCreatedParentDirectory(), GeneralUtilityTest\mkdirDeepSetsGroupOwnershipOnNewSubDirectory(), and GeneralUtilityTest\mkdirSetsGroupOwnershipOfCreatedDirectory().

checkisOnCurrentHostInvalidHosts ( )

Data provider for invalid isOnCurrentHost's

Returns
array Invalid Hosts

Definition at line 2078 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

static cmpFqdnInvalidDataProvider ( )
static

Data provider for cmpFqdnReturnsFalse

Returns
array Data sets

Definition at line 565 of file GeneralUtilityTest.php.

cmpFqdnReturnsFalse (   $baseHost,
  $list 
)
Test:
cmpFqdnInvalidDataProvider

Definition at line 577 of file GeneralUtilityTest.php.

References GeneralUtility\cmpFQDN().

cmpFqdnReturnsTrue (   $baseHost,
  $list 
)
Test:
cmpFqdnValidDataProvider

Definition at line 555 of file GeneralUtilityTest.php.

References GeneralUtility\cmpFQDN().

static cmpFqdnValidDataProvider ( )
static

Data provider for cmpFqdnReturnsTrue

Returns
array Data sets

Definition at line 535 of file GeneralUtilityTest.php.

static cmpIPv4DataProviderMatching ( )
static

Data provider for cmpIPv4ReturnsTrueForMatchingAddress

Returns
array Data sets

Definition at line 256 of file GeneralUtilityTest.php.

static cmpIPv4DataProviderNotMatching ( )
static

Data provider for cmpIPv4ReturnsFalseForNotMatchingAddress

Returns
array Data sets

Definition at line 285 of file GeneralUtilityTest.php.

cmpIPv4ReturnsFalseForNotMatchingAddress (   $ip,
  $list 
)
Test:
cmpIPv4DataProviderNotMatching

Definition at line 301 of file GeneralUtilityTest.php.

References GeneralUtility\cmpIPv4().

cmpIPv4ReturnsTrueForMatchingAddress (   $ip,
  $list 
)
Test:
cmpIPv4DataProviderMatching

Definition at line 275 of file GeneralUtilityTest.php.

References GeneralUtility\cmpIPv4().

static cmpIPv6DataProviderMatching ( )
static

Data provider for cmpIPv6ReturnsTrueForMatchingAddress

Returns
array Data sets

Definition at line 314 of file GeneralUtilityTest.php.

static cmpIPv6DataProviderNotMatching ( )
static

Data provider for cmpIPv6ReturnsFalseForNotMatchingAddress

Returns
array Data sets

Definition at line 344 of file GeneralUtilityTest.php.

cmpIPv6ReturnsFalseForNotMatchingAddress (   $ip,
  $list 
)
Test:
cmpIPv6DataProviderNotMatching

Definition at line 362 of file GeneralUtilityTest.php.

References GeneralUtility\cmpIPv6().

cmpIPv6ReturnsTrueForMatchingAddress (   $ip,
  $list 
)
Test:
cmpIPv6DataProviderMatching

Definition at line 334 of file GeneralUtilityTest.php.

References GeneralUtility\cmpIPv6().

compileSelectedGetVarsFromArrayFiltersIncomingData ( )
compileSelectedGetVarsFromArrayUsesGetPostDataFallback ( )
compressIPv6CorrectlyCompressesAdresses (   $compressed,
  $normalized 
)
Test:
normalizeCompressIPv6DataProviderCorrect

Definition at line 457 of file GeneralUtilityTest.php.

References GeneralUtility\compressIPv6().

compressIPv6CorrectlyCompressesAdressWithSomeAddressOnRightSide ( )
Test:

Definition at line 465 of file GeneralUtilityTest.php.

References GeneralUtility\compressIPv6().

copyDirectoryCopiesFilesAndDirectoriesWithAbsolutePaths ( )
copyDirectoryCopiesFilesAndDirectoriesWithRelativePaths ( )
deHSCentitiesReturnsDecodedString (   $input,
  $expected 
)
Test:
deHSCentitiesReturnsDecodedStringDataProvider

Definition at line 923 of file GeneralUtilityTest.php.

References GeneralUtility\deHSCentities().

deHSCentitiesReturnsDecodedStringDataProvider ( )

Data provider for deHSCentitiesReturnsDecodedString

Returns
array

Definition at line 933 of file GeneralUtilityTest.php.

deniedFilesDataProvider ( )
Returns
array

Definition at line 4362 of file GeneralUtilityTest.php.

deprecationLogFixesPermissionsOnLogFile ( )
dirnameDataProvider ( )
See also
dirnameWithDataProvider
Returns
array<array>

Definition at line 3843 of file GeneralUtilityTest.php.

dirnameWithDataProvider (   $input,
  $expectedValue 
)
Test:
dirnameDataProvider
Parameters
string$inputthe input for dirname
string$expectedValuethe expected return value expected from dirname

Definition at line 3862 of file GeneralUtilityTest.php.

References GeneralUtility\dirname().

expandListExpandsForTwoThousandElementsExpandsOnlyToThousandElementsMaximum ( )
Test:

Definition at line 711 of file GeneralUtilityTest.php.

References GeneralUtility\expandList().

expandListExpandsIntegerRanges (   $list,
  $expectation 
)
Test:
Parameters
string$list
string$expectationexpandListExpandsIntegerRangesDataProvider

Definition at line 683 of file GeneralUtilityTest.php.

References GeneralUtility\expandList().

expandListExpandsIntegerRangesDataProvider ( )

Data provider for expandListExpandsIntegerRangesDataProvider

Returns
array

Definition at line 693 of file GeneralUtilityTest.php.

explodeAndUnquoteImageMagickCommands (   $source,
  $expectedQuoted,
  $expectedUnquoted 
)

Tests if the commands are exploded and unquoted correctly

imageMagickCommandsDataProvider

Test:

Definition at line 3790 of file GeneralUtilityTest.php.

References GeneralUtility\unQuoteFilenames().

explodeUrl2ArrayDataProvider ( )

Data provider for explodeUrl2ArrayTransformsParameterStringToFlatArray

Returns
array

Definition at line 1202 of file GeneralUtilityTest.php.

explodeUrl2ArrayTransformsParameterStringToFlatArray (   $input,
  $expected 
)
Test:
explodeUrl2ArrayDataProvider

Definition at line 1192 of file GeneralUtilityTest.php.

References GeneralUtility\explodeUrl2Array().

explodeUrl2ArrayTransformsParameterStringToNestedArray (   $name,
  $array,
  $input 
)
Test:
implodeArrayForUrlDataProvider

Definition at line 1182 of file GeneralUtilityTest.php.

References GeneralUtility\explodeUrl2Array().

fixPermissionsDoesNotSetPermissionsToNotAllowedPath ( )
fixPermissionsSetsDefaultPermissionsToDirectory ( )
fixPermissionsSetsPermissionsToDirectoryWithTrailingSlash ( )
fixPermissionsSetsPermissionsToHiddenDirectory ( )
fixPermissionsSetsPermissionsWithRelativeFileReference ( )
formatSizeDataProvider ( )

Data provider for formatSizeTranslatesBytesToHigherOrderRepresentation

Returns
array

Definition at line 828 of file GeneralUtilityTest.php.

formatSizeTranslatesBytesToHigherOrderRepresentation (   $size,
  $labels,
  $base,
  $expected 
)
Test:
formatSizeDataProvider

Definition at line 818 of file GeneralUtilityTest.php.

References GeneralUtility\formatSize().

getAllFilesAndFoldersInPathReturnsArrayWithMd5Keys ( )
getAndPostDataProvider ( )

Data provider for canRetrieveGlobalInputsThroughGet and canRetrieveGlobalInputsThroughPost

Returns
array

Definition at line 185 of file GeneralUtilityTest.php.

getBytesFromSizeMeasurementCalculatesCorrectByteValue (   $expected,
  $byteString 
)
Test:
getBytesFromSizeMeasurementDataProvider

Definition at line 1591 of file GeneralUtilityTest.php.

References GeneralUtility\getBytesFromSizeMeasurement().

getBytesFromSizeMeasurementDataProvider ( )

Data provider for getBytesFromSizeMeasurement

Returns
array expected value, input string

Definition at line 1578 of file GeneralUtilityTest.php.

getDirsReturnsArrayOfDirectoriesFromGivenDirectory ( )
Test:

Definition at line 2413 of file GeneralUtilityTest.php.

References GeneralUtility\get_dirs().

getDirsReturnsStringErrorOnPathFailure ( )
Test:

Definition at line 2423 of file GeneralUtilityTest.php.

References GeneralUtility\get_dirs().

getFileAbsFileNameDateprovider ( )
Returns
array

Definition at line 4238 of file GeneralUtilityTest.php.

getFilesInDirByExtensionDoesNotFindFilesWithOtherExtensions ( )
getFilesInDirByExtensionFindsFiles ( )
getFilesInDirCanOrderByMtime ( )
getFilesInDirCanPrependPath ( )
getFilesInDirDoesNotFindDirectories ( )
getFilesInDirDoesNotFindDotfiles ( )

Dotfiles; current directory: '.' and parent directory: '..' must not be present.

Test:

Definition at line 3610 of file GeneralUtilityTest.php.

References GeneralUtility\getFilesInDir(), and GeneralUtilityTest\getFilesInDirCreateTestDirectory().

getFilesInDirDoesSortAlphabeticallyByDefault ( )
getFilesInDirExcludesFilesMatchingPattern ( )
getFilesInDirFindsHiddenFile ( )
getFilesInDirFindsRegularFile ( )
getFilesInDirReturnsArrayWithMd5OfElementAndPathAsArrayKey ( )
getIndpEnvForHostAllowsAllHostnameValuesIfHostPatternIsSetToAllowAll (   $httpHost,
  $hostNamePattern 
)
Parameters
string$httpHostHTTP_HOST string
string$hostNamePatterntrusted hosts pattern (not used in this test currently)
Test:
hostnamesNotMatchingTrustedHostsConfigurationDataProvider

Definition at line 1865 of file GeneralUtilityTest.php.

References $GLOBALS, GeneralUtility\ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL, and GeneralUtility\getIndpEnv().

getIndpEnvForHostThrowsExceptionForNotAllowedHostnameValues (   $httpHost,
  $hostNamePattern 
)
Parameters
string$httpHostHTTP_HOST string
string$hostNamePatterntrusted hosts pattern
Test:
hostnamesNotMatchingTrustedHostsConfigurationDataProvider

Definition at line 1849 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\getIndpEnv().

getIndpEnvTypo3HostOnlyParsesHostnamesAndIpAdresses (   $httpHost,
  $expectedIp 
)
Test:
hostnameAndPortDataProvider

Definition at line 1659 of file GeneralUtilityTest.php.

References GeneralUtility\flushInternalRuntimeCaches(), and GeneralUtility\getIndpEnv().

getIndpEnvTypo3PortParsesHostnamesAndIpAdresses (   $httpHost,
  $dummy,
  $expectedPort 
)
Test:
hostnameAndPortDataProvider

Definition at line 1876 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

getIndpEnvTypo3SitePathReturnNonEmptyString ( )
Test:

Definition at line 1602 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

getIndpEnvTypo3SitePathReturnsStringEndingWithSlash ( )
Test:

Definition at line 1632 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

getIndpEnvTypo3SitePathReturnsStringStartingWithDrive ( )
Test:

Definition at line 1620 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

getIndpEnvTypo3SitePathReturnsStringStartingWithSlash ( )
Test:

Definition at line 1610 of file GeneralUtilityTest.php.

References GeneralUtility\getIndpEnv().

getSetAssignsOneValueToOneKey ( )
Test:

Definition at line 2571 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetCanAssignAnArrayToASpecificArrayChildElement ( )
Test:

Definition at line 2616 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetCanAssignAStringValueToASpecificArrayChildElement ( )
Test:

Definition at line 2605 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetCanAssignsAnArrayToASpecificArrayElement ( )
Test:

Definition at line 2594 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetDataProvider ( )

Data provider for canSetNewGetInputValues

Returns
array

Definition at line 234 of file GeneralUtilityTest.php.

getSetForArrayDropsExistingValues ( )
Test:

Definition at line 2559 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetForOneValueDoesNotDropUnrelatedValues ( )
Test:

Definition at line 2582 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetWritesArrayToGetSystemVariable ( )
Test:

Definition at line 2535 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSetWritesArrayToGlobalsHttpGetVars ( )
Test:

Definition at line 2547 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtility\_GETset().

getSingletonInstancesContainsPreviouslySetSingletonInstance ( )
gpDataProvider ( )

Data provider for canRetrieveValueWithGP. All test values also check whether slashes are stripped properly.

Returns
array

Definition at line 125 of file GeneralUtilityTest.php.

gpMergedDataProvider ( )

Data provider for gpMergedWillMergeArraysFromGetAndPost

Returns
array

Definition at line 161 of file GeneralUtilityTest.php.

gpMergedWillMergeArraysFromGetAndPost (   $get,
  $post,
  $expected 
)
Test:
gpMergedDataProvider

Definition at line 149 of file GeneralUtilityTest.php.

References GeneralUtility\_GPmerged().

hmacReturnsEqualHashesForEqualInput ( )
Test:

Definition at line 2447 of file GeneralUtilityTest.php.

References GeneralUtility\hmac().

hmacReturnsHashOfProperLength ( )
Test:

Definition at line 2437 of file GeneralUtilityTest.php.

References GeneralUtility\hmac().

hmacReturnsNoEqualHashesForNonEqualInput ( )
Test:

Definition at line 2457 of file GeneralUtilityTest.php.

References GeneralUtility\hmac().

static hostnameAndPortDataProvider ( )
static
Returns
array

Definition at line 1641 of file GeneralUtilityTest.php.

static hostnamesMatchingTrustedHostsConfigurationDataProvider ( )
static
Returns
array

Definition at line 1678 of file GeneralUtilityTest.php.

static hostnamesNotMatchingTrustedHostsConfigurationDataProvider ( )
static
Returns
array

Definition at line 1694 of file GeneralUtilityTest.php.

htmlspecialcharsDecodeReturnsDecodedString ( )
Test:

Definition at line 908 of file GeneralUtilityTest.php.

idnaEncodeConvertsUnicodeCharsToASCIIString (   $actual,
  $expected 
)
Test:
idnaEncodeDataProvider
Parameters
$actual
$expected

Definition at line 4740 of file GeneralUtilityTest.php.

References GeneralUtility\idnaEncode().

idnaEncodeDataProvider ( )

Data provider for method idnaEncode in GeneralUtility class. IDNA converter has to convert special chars (UTF-8) to ASCII compatible chars.

Returns
array

Definition at line 4752 of file GeneralUtilityTest.php.

imageMagickCommandsDataProvider ( )

Data provider for ImageMagick shell commands

See also
explodeAndUnquoteImageMagickCommands

Definition at line 3626 of file GeneralUtilityTest.php.

implodeArrayForUrlBuildsValidParameterString (   $name,
  $input,
  $expected 
)
Test:
implodeArrayForUrlDataProvider

Definition at line 1153 of file GeneralUtilityTest.php.

References GeneralUtility\implodeArrayForUrl().

implodeArrayForUrlCanSkipEmptyParameters ( )
Test:

Definition at line 1161 of file GeneralUtilityTest.php.

References GeneralUtility\implodeArrayForUrl().

implodeArrayForUrlCanUrlEncodeKeyNames ( )
Test:

Definition at line 1171 of file GeneralUtilityTest.php.

References GeneralUtility\implodeArrayForUrl().

implodeArrayForUrlDataProvider ( )

Data provider for implodeArrayForUrlBuildsValidParameterString and explodeUrl2ArrayTransformsParameterStringToArray

Returns
array

Definition at line 1138 of file GeneralUtilityTest.php.

inListForItemContainedReturnsTrue (   $haystack)
Test:
Parameters
string$haystackinListForItemContainedReturnsTrueDataProvider

Definition at line 590 of file GeneralUtilityTest.php.

References GeneralUtility\inList().

inListForItemContainedReturnsTrueDataProvider ( )

Data provider for inListForItemContainedReturnsTrue.

Returns
array

Definition at line 600 of file GeneralUtilityTest.php.

inListForItemNotContainedReturnsFalse (   $haystack)
Test:
Parameters
string$haystackinListForItemNotContainedReturnsFalseDataProvider

Definition at line 615 of file GeneralUtilityTest.php.

References GeneralUtility\inList().

inListForItemNotContainedReturnsFalseDataProvider ( )

Data provider for inListForItemNotContainedReturnsFalse.

Returns
array

Definition at line 625 of file GeneralUtilityTest.php.

intExplodeConvertsStringsToInteger ( )
Test:

Definition at line 1121 of file GeneralUtilityTest.php.

References GeneralUtility\intExplode().

static invalidIpDataProvider ( )
static

Data provider for checkValidIpReturnsFalseForInvalidIp

Returns
array Data sets

Definition at line 505 of file GeneralUtilityTest.php.

IPv6Bin2HexCorrectlyConvertsAddresses (   $binary,
  $hex 
)
Test:
IPv6Bin2HexDataProviderCorrect

Definition at line 419 of file GeneralUtilityTest.php.

References GeneralUtility\IPv6Bin2Hex().

static IPv6Bin2HexDataProviderCorrect ( )
static

Data provider for IPv6Bin2HexCorrect

Returns
array Data sets

Definition at line 403 of file GeneralUtilityTest.php.

IPv6Hex2BinCorrectlyConvertsAddresses (   $hex,
  $binary 
)
Test:
IPv6Hex2BinDataProviderCorrect

Definition at line 390 of file GeneralUtilityTest.php.

References GeneralUtility\IPv6Hex2Bin().

static IPv6Hex2BinDataProviderCorrect ( )
static

Data provider for IPv6Hex2BinCorrect

Returns
array Data sets

Definition at line 375 of file GeneralUtilityTest.php.

isAllowedHostHeaderValueReturnsFalseIfHostValueMatches (   $httpHost,
  $hostNamePattern 
)
Parameters
string$httpHostHTTP_HOST string
string$hostNamePatterntrusted hosts pattern
Test:
hostnamesNotMatchingTrustedHostsConfigurationDataProvider

Definition at line 1724 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtilityFixture\isAllowedHostHeaderValue().

isAllowedHostHeaderValueReturnsFalseIfTrusedHostsIsNotConfigured ( )
isAllowedHostHeaderValueReturnsTrueIfHostValueMatches (   $httpHost,
  $hostNamePattern 
)
Parameters
string$httpHostHTTP_HOST string
string$hostNamePatterntrusted hosts pattern
Test:
hostnamesMatchingTrustedHostsConfigurationDataProvider

Definition at line 1712 of file GeneralUtilityTest.php.

References $GLOBALS, and GeneralUtilityFixture\isAllowedHostHeaderValue().

isAllowedHostHeaderValueWorksCorrectlyWithWithServerNamePattern (   $httpHost,
  $serverName,
  $isAllowed,
  $serverPort = '80',
  $ssl = 'Off' 
)
Parameters
string$httpHost
string$serverName
bool$isAllowed
string$serverPort
string$ssl
Test:
serverNamePatternDataProvider

Definition at line 1819 of file GeneralUtilityTest.php.

References $GLOBALS, GeneralUtility\ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME, and GeneralUtilityFixture\isAllowedHostHeaderValue().

isConnected ( )

Helper method to test for an existing internet connection. Some tests are skipped if there is no working uplink.

Returns
bool $isConnected

Definition at line 79 of file GeneralUtilityTest.php.

isFirstPartOfStrReturnsFalseForNotMatchingFirstPart (   $string,
  $part 
)
Test:
isFirstPartOfStrReturnsFalseForNotMatchingFirstPartDataProvider

Definition at line 806 of file GeneralUtilityTest.php.

References GeneralUtility\isFirstPartOfStr().

isFirstPartOfStrReturnsFalseForNotMatchingFirstPartDataProvider ( )

Data provider for checkIsFirstPartOfStrReturnsFalseForNotMatchingFirstParts

Returns
array

Definition at line 780 of file GeneralUtilityTest.php.

isFirstPartOfStrReturnsTrueForMatchingFirstPart (   $string,
  $part 
)
Test:
isFirstPartOfStrReturnsTrueForMatchingFirstPartDataProvider

Definition at line 770 of file GeneralUtilityTest.php.

References GeneralUtility\isFirstPartOfStr().

isFirstPartOfStrReturnsTrueForMatchingFirstPartDataProvider ( )

Data provider for isFirstPartOfStrReturnsTrueForMatchingFirstParts

Returns
array

Definition at line 755 of file GeneralUtilityTest.php.

isMinifyJavaScriptHookCalledCallback ( array  $params)

Callback function used in minifyJavaScriptCallsRegisteredHookWithInputString test

Parameters
array$params

Definition at line 2668 of file GeneralUtilityTest.php.

isOnCurrentHostReturnsTrueWithCurrentHost ( )
isValidUrlInvalidRessourceDataProvider ( )

Data provider for invalid isValidUrl's

Returns
array Invalid ressource

Definition at line 2032 of file GeneralUtilityTest.php.

lcFirst (   $expected,
  $inputString 
)
Test:
lcfirstDataProvider

Definition at line 1980 of file GeneralUtilityTest.php.

References GeneralUtility\lcfirst().

lcfirstDataProvider ( )

Data provider for lcFirst

Returns
array expected, input string

Definition at line 1967 of file GeneralUtilityTest.php.

makeInstanceCalledTwoTimesAfterAddInstanceReturnTwoDifferentInstances ( )
makeInstanceCalledTwoTimesForNonSingletonClassReturnsDifferentInstances ( )
Test:

Definition at line 4030 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceCalledTwoTimesForSingletonClassReturnsSameInstance ( )
Test:

Definition at line 4039 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceCalledTwoTimesForSingletonClassWithPurgeInstancesInbetweenReturnsDifferentInstances ( )
makeInstanceInstanciatesConfiguredImplementation ( )
makeInstancePassesParametersToConstructor ( )
Test:

Definition at line 3999 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceResolvesConfiguredImplementationsRecursively ( )
makeInstanceReturnsClassInstance ( )
Test:

Definition at line 3990 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithBeginningSlashInClassNameThrowsException ( )
Test:

Definition at line 3979 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithEmptyArrayThrowsException ( )
Test:

Definition at line 3957 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithEmptyClassNameThrowsException ( )
Test:

Definition at line 3924 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithNonEmptyArrayThrowsException ( )
Test:

Definition at line 3968 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithNullClassNameThrowsException ( )
Test:

Definition at line 3935 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

makeInstanceWithZeroStringClassNameThrowsException ( )
Test:

Definition at line 3946 of file GeneralUtilityTest.php.

References GeneralUtility\makeInstance().

minifyJavaScriptCallsRegisteredHookWithInputString ( )

Create an own hook callback class, register as hook, and check if given string to compress is given to hook method

Test:

Definition at line 2647 of file GeneralUtilityTest.php.

References $GLOBALS, BaseTestCase\getUniqueId(), and GeneralUtility\minifyJavaScript().

minifyJavaScriptErroneousCallback ( )

Callback function used in minifyJavaScriptReturnsErrorStringOfHookException and minifyJavaScriptWritesExceptionMessageToDevLog

Exceptions
RuntimeException

Definition at line 2732 of file GeneralUtilityTest.php.

minifyJavaScriptReturnsErrorStringOfHookException ( )

Create a hook callback, use callback to throw an exception and check if the exception is given as error parameter to the calling method.

Test:

Definition at line 2684 of file GeneralUtilityTest.php.

References $GLOBALS, BaseTestCase\getUniqueId(), and GeneralUtility\minifyJavaScript().

minifyJavaScriptReturnsInputStringIfNoHookIsRegistered ( )
minifyJavaScriptWritesExceptionMessageToDevLog ( )

Check if the error message that is returned by the hook callback is logged to ::devLog.

Test:

Definition at line 2708 of file GeneralUtilityTest.php.

References $GLOBALS, BaseTestCase\getUniqueId(), and GeneralUtility\minifyJavaScript().

mkdirCreatesDirectory ( )
mkdirCreatesDirectoryWithTrailingSlash ( )
mkdirCreatesHiddenDirectory ( )
mkdirDeepCreatesDirectory ( )
mkdirDeepCreatesDirectoryInVfsStream ( )
mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider ( )

Data provider for mkdirDeepCreatesDirectoryWithDoubleSlashes.

Returns
array

Definition at line 3128 of file GeneralUtilityTest.php.

mkdirDeepCreatesDirectoryWithDoubleSlashes (   $directoryToCreate)
Test:
mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider

Definition at line 3140 of file GeneralUtilityTest.php.

References FileStreamWrapper\destroy(), FileStreamWrapper\init(), GeneralUtility\mkdir_deep(), and FileStreamWrapper\registerOverlayPath().

mkdirDeepCreatesSubdirectoriesRecursive ( )
mkdirDeepDoesNotChangePermissionsOfExistingSubDirectories ( )
mkdirDeepFixesPermissionsOfCreatedDirectory ( )
mkdirDeepFixesPermissionsOnNewParentDirectory ( )
mkdirDeepSetsGroupOwnershipOfCreatedDirectory ( )
mkdirDeepSetsGroupOwnershipOfCreatedParentDirectory ( )
mkdirDeepSetsGroupOwnershipOnNewSubDirectory ( )
mkdirDeepThrowsExceptionIfBaseDirectoryIsNotOfTypeString ( )
Test:

Definition at line 3288 of file GeneralUtilityTest.php.

References GeneralUtility\mkdir_deep().

mkdirDeepThrowsExceptionIfDeepDirectoryIsNotOfTypeString ( )
Test:

Definition at line 3299 of file GeneralUtilityTest.php.

References GeneralUtility\mkdir_deep().

mkdirDeepThrowsExceptionIfDirectoryCreationFails ( )
Test:

Definition at line 3277 of file GeneralUtilityTest.php.

References GeneralUtility\mkdir_deep().

mkdirSetsPermissionsOfCreatedDirectory ( )
static normalizeCompressIPv6DataProviderCorrect ( )
static

Data provider for normalizeIPv6ReturnsCorrectlyNormalizedFormat

Returns
array Data sets

Definition at line 432 of file GeneralUtilityTest.php.

normalizeIPv6CorrectlyNormalizesAddresses (   $compressed,
  $normalized 
)
Test:
normalizeCompressIPv6DataProviderCorrect

Definition at line 448 of file GeneralUtilityTest.php.

References GeneralUtility\normalizeIPv6().

providerForXml2Array ( )
Returns
array

Definition at line 4667 of file GeneralUtilityTest.php.

purgeInstancesDropsAddedInstance ( )
quoteJsValueDataProvider ( )

Data provider for quoteJSvalueTest.

Returns
array

Definition at line 2472 of file GeneralUtilityTest.php.

quoteJsValueTest (   $input,
  $expected 
)
Test:
Parameters
string$input
string$expectedquoteJsValueDataProvider

Definition at line 2524 of file GeneralUtilityTest.php.

References GeneralUtility\quoteJSvalue().

rawUrlEncodeFpPreservesSlashes ( )
Test:

Definition at line 991 of file GeneralUtilityTest.php.

References GeneralUtility\rawUrlEncodeFP().

rawUrlEncodeJsPreservesWhitespaces ( )
Test:

Definition at line 978 of file GeneralUtilityTest.php.

References GeneralUtility\rawUrlEncodeJS().

removeDotsFromTypoScriptOverridesSubArray ( )
Test:

Definition at line 2358 of file GeneralUtilityTest.php.

References GeneralUtility\removeDotsFromTS().

removeDotsFromTypoScriptOverridesWithScalar ( )
Test:

Definition at line 2385 of file GeneralUtilityTest.php.

References GeneralUtility\removeDotsFromTS().

removeDotsFromTypoScriptSucceedsWithDottedArray ( )
Test:

Definition at line 2332 of file GeneralUtilityTest.php.

References GeneralUtility\removeDotsFromTS().

resetSingletonInstancesResetsPreviouslySetInstance ( )
resetSingletonInstancesSetsGivenInstance ( )
resolveBackPathDataProvider ( )
See also
resolveBackPathWithDataProvider
Returns
array<array>

Definition at line 3874 of file GeneralUtilityTest.php.

resolveBackPathWithDataProvider (   $input,
  $expectedValue 
)
Test:
resolveBackPathDataProvider
Parameters
string$inputthe input for resolveBackPath
$expectedValueExpected return value from resolveBackPath

Definition at line 3913 of file GeneralUtilityTest.php.

References GeneralUtility\resolveBackPath().

revExplodeCorrectlyExplodesStringForGivenPartsCount (   $delimiter,
  $testString,
  $count,
  $expectedArray 
)
Test:
revExplodeDataProvider

Definition at line 1316 of file GeneralUtilityTest.php.

References GeneralUtility\revExplode().

revExplodeDataProvider ( )
Returns
array

Definition at line 1246 of file GeneralUtilityTest.php.

revExplodeRespectsLimitThreeWhenExploding ( )
Test:

Definition at line 1325 of file GeneralUtilityTest.php.

References GeneralUtility\revExplode().

rmdirDoesNotRemoveDirectoryWithFilesAndReturnsFalseIfRecursiveDeletionIsOff ( )
rmdirRemovesDeadLinkToDirectory ( )
rmdirRemovesDeadLinkToFile ( )
rmdirRemovesDirectoriesRecursiveAndReturnsTrue ( )
rmdirRemovesDirectory ( )
rmdirRemovesDirectoryWithTrailingSlash ( )
rmdirRemovesFile ( )
rmdirRemovesLinkToDirectory ( )
rmdirReturnFalseIfNoFileWasRemoved ( )
rmdirReturnTrueIfFileWasRemoved ( )
rmFromListRemovesElementsFromCommaSeparatedList (   $initialList,
  $listWithElementRemoved 
)
Test:
Parameters
string$initialList
string$listWithElementRemovedrmFromListRemovesElementsFromCommaSeparatedListDataProvider

Definition at line 643 of file GeneralUtilityTest.php.

References GeneralUtility\rmFromList().

rmFromListRemovesElementsFromCommaSeparatedListDataProvider ( )

Data provider for rmFromListRemovesElementsFromCommaSeparatedList

Returns
array

Definition at line 653 of file GeneralUtilityTest.php.

sanitizeLocalUrlAcceptsEncodedValidPaths (   $path)
Test:
Parameters
string$pathsanitizeLocalUrlValidPathsDataProvider

Definition at line 2126 of file GeneralUtilityTest.php.

References GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlAcceptsEncodedValidUrls (   $url,
  $host,
  $subDirectory 
)
Test:
Parameters
string$url
string$host
string$subDirectorysanitizeLocalUrlValidUrlsDataProvider

Definition at line 2187 of file GeneralUtilityTest.php.

References GeneralUtility\flushInternalRuntimeCaches(), and GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlAcceptsNotEncodedValidPaths (   $path)
Test:
Parameters
string$pathsanitizeLocalUrlValidPathsDataProvider

Definition at line 2116 of file GeneralUtilityTest.php.

References GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlAcceptsNotEncodedValidUrls (   $url,
  $host,
  $subDirectory 
)
Test:
Parameters
string$url
string$host
string$subDirectorysanitizeLocalUrlValidUrlsDataProvider

Definition at line 2172 of file GeneralUtilityTest.php.

References GeneralUtility\flushInternalRuntimeCaches(), and GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlDeniesEncodedInvalidUrls (   $url)
Test:
sanitizeLocalUrlInvalidDataProvider

Definition at line 2226 of file GeneralUtilityTest.php.

References GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlDeniesPlainInvalidUrls (   $url)
Test:
sanitizeLocalUrlInvalidDataProvider

Definition at line 2217 of file GeneralUtilityTest.php.

References GeneralUtility\sanitizeLocalUrl().

sanitizeLocalUrlInvalidDataProvider ( )

Data provider for invalid sanitizeLocalUrl's

Returns
array Valid url

Definition at line 2200 of file GeneralUtilityTest.php.

sanitizeLocalUrlValidPathsDataProvider ( )

Data provider for valid sanitizeLocalUrl paths

Returns
array Valid url

Definition at line 2098 of file GeneralUtilityTest.php.

sanitizeLocalUrlValidUrlsDataProvider ( )

Data provider for valid sanitizeLocalUrl's

Returns
array Valid url

Definition at line 2136 of file GeneralUtilityTest.php.

serverNamePatternDataProvider ( )

Definition at line 1730 of file GeneralUtilityTest.php.

setSingletonInstanceCalledTwoTimesMakesMakeInstanceReturnLastSetInstance ( )
setSingletonInstanceForClassThatIsNoSubclassOfProvidedClassThrowsException ( )
setSingletonInstanceForEmptyClassNameThrowsException ( )
setSingletonInstanceMakesMakeInstanceReturnThatInstance ( )
slashJsDataProvider ( )

Data provider for slashJsEscapesSingleQuotesAndSlashes

Returns
array

Definition at line 961 of file GeneralUtilityTest.php.

slashJsEscapesSingleQuotesAndSlashes (   $input,
  $extended,
  $expected 
)
Test:
slashJsDataProvider

Definition at line 951 of file GeneralUtilityTest.php.

References GeneralUtility\slashJS().

splitCalcCorrectlySplitsExpression (   $expected,
  $expression 
)
Test:
splitCalcDataProvider

Definition at line 897 of file GeneralUtilityTest.php.

References GeneralUtility\splitCalc().

splitCalcDataProvider ( )

Data provider for splitCalc

Returns
array expected values, arithmetic expression

Definition at line 875 of file GeneralUtilityTest.php.

splitFileRefReturnsFileTypeForFilesWithoutPathSite ( )
Test:

Definition at line 3825 of file GeneralUtilityTest.php.

References GeneralUtility\split_fileref().

splitFileRefReturnsFileTypeNotForFolders ( )
strtolowerConvertsOnlyLatinCharacters (   $expected,
  $input 
)
Test:
strtouppperDataProvider

Definition at line 1028 of file GeneralUtilityTest.php.

References GeneralUtility\strtolower().

strtoupperConvertsOnlyLatinCharacters (   $input,
  $expected 
)
Test:
strtouppperDataProvider

Definition at line 1019 of file GeneralUtilityTest.php.

References GeneralUtility\strtoupper().

strtouppperDataProvider ( )

Data provider for strtoupper and strtolower

Returns
array

Definition at line 1006 of file GeneralUtilityTest.php.

syslogFixesPermissionsOnFileIfUsingFileLogging ( )
tearDown ( )
protected
tempnamReturnsAbsolutePathInsideDocumentRoot ( )
Test:

Definition at line 2319 of file GeneralUtilityTest.php.

References GeneralUtility\tempnam().

tempnamReturnsPathStartingWithGivenPrefix ( )
Test:

Definition at line 2298 of file GeneralUtilityTest.php.

References GeneralUtility\tempnam().

tempnamReturnsPathWithoutBackslashes ( )
Test:

Definition at line 2309 of file GeneralUtilityTest.php.

References GeneralUtility\tempnam().

trimExplodeReturnsCorrectResult (   $delimiter,
  $testString,
  $removeEmpty,
  $limit,
  $expectedResult 
)
Test:
trimExplodeReturnsCorrectResultDataProvider
Parameters
string$delimiter
string$testString
bool$removeEmpty
int$limit
array$expectedResult

Definition at line 1346 of file GeneralUtilityTest.php.

References GeneralUtility\trimExplode().

trimExplodeReturnsCorrectResultDataProvider ( )
Returns
array

Definition at line 1354 of file GeneralUtilityTest.php.

underscoredToLowerCamelCase (   $expected,
  $inputString 
)
Test:
underscoredToLowerCamelCaseDataProvider

Definition at line 1927 of file GeneralUtilityTest.php.

References GeneralUtility\underscoredToLowerCamelCase().

underscoredToLowerCamelCaseDataProvider ( )

Data provider for underscoredToLowerCamelCase

Returns
array expected, input string

Definition at line 1915 of file GeneralUtilityTest.php.

underscoredToUpperCamelCase (   $expected,
  $inputString 
)
Test:
underscoredToUpperCamelCaseDataProvider

Definition at line 1902 of file GeneralUtilityTest.php.

References GeneralUtility\underscoredToUpperCamelCase().

underscoredToUpperCamelCaseDataProvider ( )

Data provider for underscoredToUpperCamelCase

Returns
array expected, input string

Definition at line 1890 of file GeneralUtilityTest.php.

uniqueListUnifiesCommaSeparatedList (   $initialList,
  $unifiedList 
)
Test:
Parameters
string$initialList
string$unifiedListuniqueListUnifiesCommaSeparatedListDataProvider

Definition at line 726 of file GeneralUtilityTest.php.

References GeneralUtility\uniqueList().

uniqueListUnifiesCommaSeparatedListDataProvider ( )

Data provider for uniqueListUnifiesCommaSeparatedList

Returns
array

Definition at line 736 of file GeneralUtilityTest.php.

unlink_tempfileRemovesHiddenFile ( )
unlink_tempfileRemovesValidFileInTypo3temp ( )
unlink_tempfileReturnsNullIfFileDoesNotExist ( )
unlink_tempfileReturnsNullIfFileIsNowWithinTypo3temp ( )
Test:

Definition at line 2285 of file GeneralUtilityTest.php.

References GeneralUtility\unlink_tempfile().

unlink_tempfileReturnsTrueIfFileWasRemoved ( )
user_calledUserFunction ( )
Returns
string

Definition at line 4566 of file GeneralUtilityTest.php.

user_calledUserFunctionCountCallers ( $params)

Takes the object hash and adds it to the passed array. In case persisting the objects would not work we'd see two different parent objects.

Parameters
$params

Definition at line 4599 of file GeneralUtilityTest.php.

validEmailInvalidDataProvider ( )

Data provider for invalid validEmail's

Returns
array Invalid email addresses

Definition at line 1073 of file GeneralUtilityTest.php.

validEmailReturnsFalseForInvalidMailAddress (   $address)
Test:
validEmailInvalidDataProvider

Definition at line 1110 of file GeneralUtilityTest.php.

References GeneralUtility\validEmail().

validEmailReturnsTrueForValidMailAddress (   $address)
Test:
validEmailValidDataProvider

Definition at line 1063 of file GeneralUtilityTest.php.

References GeneralUtility\validEmail().

validEmailValidDataProvider ( )

Data provider for valid validEmail's

Returns
array Valid email addresses

Definition at line 1041 of file GeneralUtilityTest.php.

static validIpDataProvider ( )
static

Data provider for checkValidIpReturnsTrueForValidIp

Returns
array Data sets

Definition at line 481 of file GeneralUtilityTest.php.

validIpReturnsFalseForInvalidIp (   $ip)
Test:
invalidIpDataProvider

Definition at line 522 of file GeneralUtilityTest.php.

References GeneralUtility\validIP().

validIpReturnsTrueForValidIp (   $ip)
Test:
validIpDataProvider

Definition at line 495 of file GeneralUtilityTest.php.

References GeneralUtility\validIP().

validPathStrDataProvider ( )

Data provider for positive values within validPathStr()

Definition at line 4338 of file GeneralUtilityTest.php.

validPathStrDetectsInvalidCharacters (   $path)

Tests whether invalid characters are detected.

Parameters
string$pathvalidPathStrInvalidCharactersDataProvider
Test:

Definition at line 4330 of file GeneralUtilityTest.php.

References GeneralUtility\validPathStr().

validPathStrInvalidCharactersDataProvider ( )

Data provider for validPathStrDetectsInvalidCharacters.

Returns
array

Definition at line 4295 of file GeneralUtilityTest.php.

validPathStrWorksWithUnicodeFileNames (   $path)

Tests whether Unicode characters are recognized as valid file name characters.

validPathStrDataProvider

Test:

Definition at line 4354 of file GeneralUtilityTest.php.

References GeneralUtility\validPathStr().

validURLReturnsFalseForInvalidRessoure (   $url)
Test:
isValidUrlInvalidRessourceDataProvider

Definition at line 2056 of file GeneralUtilityTest.php.

References GeneralUtility\isValidUrl().

validURLReturnsTrueForValidResource (   $url)
Test:
validUrlValidResourceDataProvider

Definition at line 2022 of file GeneralUtilityTest.php.

References GeneralUtility\isValidUrl().

validUrlValidResourceDataProvider ( )

Data provider for valid isValidUrl's

Returns
array Valid resource

Definition at line 1993 of file GeneralUtilityTest.php.

verifyFilenameAgainstDenyPatternDetectsNotAllowedFiles (   $deniedFile)

Tests whether verifyFilenameAgainstDenyPattern detects denied files.

Parameters
string$deniedFile
Test:
deniedFilesDataProvider

Definition at line 4384 of file GeneralUtilityTest.php.

References GeneralUtility\verifyFilenameAgainstDenyPattern().

xml2ArrayConvertsEmptyArraysToElementWithoutContent ( )

If the element is not empty, its contents might be treated as "something" (instead of "nothing") e.g. by Fluid view helpers, which is why we want to avoid that.

Test:

Definition at line 4651 of file GeneralUtilityTest.php.

References GeneralUtility\array2xml().

xml2ArrayDealsProperlyWithWhitespace ( string  $input)
Test:
providerForXml2Array
Parameters
string$input

Definition at line 4722 of file GeneralUtilityTest.php.

References GeneralUtility\xml2array().

Member Data Documentation

$backupPackageManager
protected

Definition at line 48 of file GeneralUtilityTest.php.

$singletonInstances = []
protected

Definition at line 43 of file GeneralUtilityTest.php.

const NO_FIX_PERMISSIONS_ON_WINDOWS = 'fixPermissions() not available on Windows (method does nothing)'

Definition at line 39 of file GeneralUtilityTest.php.