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

Public Member Functions

 initializeObjectThrowsNoExceptionIfGivenDatabaseWasSuccessfullySelected ()
 
 setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNotAnInteger ()
 
 setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNegative ()
 
 setCompressionThrowsExceptionIfCompressionParameterIsNotOfTypeBoolean ()
 
 setCompressionLevelThrowsExceptionIfCompressionLevelIsNotInteger ()
 
 setCompressionLevelThrowsExceptionIfCompressionLevelIsNotBetweenMinusOneAndNine ()
 
 setThrowsExceptionIfIdentifierIsNotAString ()
 
 setThrowsExceptionIfDataIsNotAString ()
 
 setThrowsExceptionIfLifetimeIsNegative ()
 
 setThrowsExceptionIfLifetimeIsNotNullOrAnInteger ()
 
 setStoresEntriesInSelectedDatabase ()
 
 setSavesStringDataTypeForIdentifierToDataEntry ()
 
 setSavesEntryWithDefaultLifeTime ()
 
 setSavesEntryWithSpecifiedLifeTime ()
 
 setSavesEntryWithUnlimitedLifeTime ()
 
 setOverwritesExistingEntryWithNewData ()
 
 setOverwritesExistingEntryWithSpecifiedLifetime ()
 
 setOverwritesExistingEntryWithNewDefaultLifetime ()
 
 setOverwritesExistingEntryWithNewUnlimitedLifetime ()
 
 setSavesSetDataTypeForIdentifierToTagsSet ()
 
 setSavesSpecifiedTagsInIdentifierToTagsSet ()
 
 setRemovesAllPreviouslySetTagsFromIdentifierToTagsSet ()
 
 setRemovesMultiplePreviouslySetTagsFromIdentifierToTagsSet ()
 
 setSavesSetDataTypeForTagToIdentifiersSet ()
 
 setSavesIdentifierInTagToIdentifiersSetOfSpecifiedTag ()
 
 setAppendsSecondIdentifierInTagToIdentifiersEntry ()
 
 setRemovesIdentifierFromTagToIdentifiersEntryIfTagIsOmittedOnConsecutiveSet ()
 
 setAddsIdentifierInTagToIdentifiersEntryIfTagIsAddedOnConsecutiveSet ()
 
 setSavesCompressedDataWithEnabledCompression ()
 
 setSavesPlaintextDataWithEnabledCompressionAndCompressionLevel0 ()
 
 hasThrowsExceptionIfIdentifierIsNotAString ()
 
 hasReturnsFalseForNotExistingEntry ()
 
 hasReturnsTrueForPreviouslySetEntry ()
 
 getThrowsExceptionIfIdentifierIsNotAString ()
 
 getReturnsPreviouslyCompressedSetEntry ()
 
 getReturnsPreviouslySetEntry ()
 
 removeThrowsExceptionIfIdentifierIsNotAString ()
 
 removeReturnsFalseIfNoEntryWasDeleted ()
 
 removeReturnsTrueIfAnEntryWasDeleted ()
 
 removeDeletesEntryFromCache ()
 
 removeDeletesIdentifierToTagEntry ()
 
 removeDeletesIdentifierFromTagToIdentifiersSet ()
 
 removeDeletesIdentifierFromTagToIdentifiersSetWithMultipleEntries ()
 
 findIdentifiersByTagThrowsExceptionIfTagIsNotAString ()
 
 findIdentifiersByTagReturnsEmptyArrayForNotExistingTag ()
 
 findIdentifiersByTagReturnsAllIdentifiersTagedWithSpecifiedTag ()
 
 flushRemovesAllEntriesFromCache ()
 
 flushByTagThrowsExceptionIfTagIsNotAString ()
 
 flushByTagRemovesEntriesTaggedWithSpecifiedTag ()
 
 flushByTagsRemovesEntriesTaggedWithSpecifiedTags ()
 
 flushByTagRemovesTemporarySet ()
 
 flushByTagRemovesIdentifierToTagsSetOfEntryTaggedWithGivenTag ()
 
 flushByTagDoesNotRemoveIdentifierToTagsSetOfUnrelatedEntry ()
 
 flushByTagRemovesTagToIdentifiersSetOfGivenTag ()
 
 flushByTagRemovesIdentifiersTaggedWithGivenTagFromTagToIdentifiersSets ()
 
 collectGarbageDoesNotRemoveNotExpiredIdentifierToDataEntry ()
 
 collectGarbageRemovesLeftOverIdentifierToTagsSet ()
 
 collectGarbageRemovesExpiredIdentifierFromTagsToIdentifierSet ()
 

Protected Member Functions

 setUp ()
 
 setUpBackend (array $backendOptions=[])
 
 setUpRedis ()
 
 tearDown ()
 
- 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

 $backend = null
 
 $redis = null
 
- Protected Attributes inherited from UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Testcase for the cache to redis backend

This class has functional tests as well as implementation tests:

  • The functional tests make API calls to the backend and check expected behaviour
  • The implementation tests make additional calls with an own redis instance to check stored data structures in the redis server, which can not be checked by functional tests alone. Those tests will fail if any changes to the internal data structure are done.

Warning: The unit tests use and flush redis database numbers 0 and 1!

Definition at line 31 of file RedisBackendTest.php.

Member Function Documentation

collectGarbageDoesNotRemoveNotExpiredIdentifierToDataEntry ( )
collectGarbageRemovesExpiredIdentifierFromTagsToIdentifierSet ( )
collectGarbageRemovesLeftOverIdentifierToTagsSet ( )
findIdentifiersByTagReturnsAllIdentifiersTagedWithSpecifiedTag ( )
findIdentifiersByTagReturnsEmptyArrayForNotExistingTag ( )
findIdentifiersByTagThrowsExceptionIfTagIsNotAString ( )
flushByTagDoesNotRemoveIdentifierToTagsSetOfUnrelatedEntry ( )
flushByTagRemovesEntriesTaggedWithSpecifiedTag ( )
flushByTagRemovesIdentifiersTaggedWithGivenTagFromTagToIdentifiersSets ( )
flushByTagRemovesIdentifierToTagsSetOfEntryTaggedWithGivenTag ( )
flushByTagRemovesTagToIdentifiersSetOfGivenTag ( )
flushByTagRemovesTemporarySet ( )
flushByTagsRemovesEntriesTaggedWithSpecifiedTags ( )
flushByTagThrowsExceptionIfTagIsNotAString ( )
flushRemovesAllEntriesFromCache ( )
getReturnsPreviouslyCompressedSetEntry ( )
getReturnsPreviouslySetEntry ( )
getThrowsExceptionIfIdentifierIsNotAString ( )
hasReturnsFalseForNotExistingEntry ( )
hasReturnsTrueForPreviouslySetEntry ( )
hasThrowsExceptionIfIdentifierIsNotAString ( )
initializeObjectThrowsNoExceptionIfGivenDatabaseWasSuccessfullySelected ( )
removeDeletesEntryFromCache ( )
removeDeletesIdentifierFromTagToIdentifiersSet ( )
removeDeletesIdentifierFromTagToIdentifiersSetWithMultipleEntries ( )
removeDeletesIdentifierToTagEntry ( )
removeReturnsFalseIfNoEntryWasDeleted ( )
removeReturnsTrueIfAnEntryWasDeleted ( )
removeThrowsExceptionIfIdentifierIsNotAString ( )
setAddsIdentifierInTagToIdentifiersEntryIfTagIsAddedOnConsecutiveSet ( )
setAppendsSecondIdentifierInTagToIdentifiersEntry ( )
setCompressionLevelThrowsExceptionIfCompressionLevelIsNotBetweenMinusOneAndNine ( )
setCompressionLevelThrowsExceptionIfCompressionLevelIsNotInteger ( )
setCompressionThrowsExceptionIfCompressionParameterIsNotOfTypeBoolean ( )
setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNegative ( )
setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNotAnInteger ( )
setOverwritesExistingEntryWithNewData ( )
setOverwritesExistingEntryWithNewDefaultLifetime ( )
setOverwritesExistingEntryWithNewUnlimitedLifetime ( )
setOverwritesExistingEntryWithSpecifiedLifetime ( )
setRemovesAllPreviouslySetTagsFromIdentifierToTagsSet ( )
setRemovesIdentifierFromTagToIdentifiersEntryIfTagIsOmittedOnConsecutiveSet ( )
setRemovesMultiplePreviouslySetTagsFromIdentifierToTagsSet ( )
setSavesCompressedDataWithEnabledCompression ( )
setSavesEntryWithDefaultLifeTime ( )
setSavesEntryWithSpecifiedLifeTime ( )
setSavesEntryWithUnlimitedLifeTime ( )
setSavesIdentifierInTagToIdentifiersSetOfSpecifiedTag ( )
setSavesPlaintextDataWithEnabledCompressionAndCompressionLevel0 ( )
setSavesSetDataTypeForIdentifierToTagsSet ( )
setSavesSetDataTypeForTagToIdentifiersSet ( )
setSavesSpecifiedTagsInIdentifierToTagsSet ( )
setSavesStringDataTypeForIdentifierToDataEntry ( )
setStoresEntriesInSelectedDatabase ( )
setThrowsExceptionIfDataIsNotAString ( )
setThrowsExceptionIfIdentifierIsNotAString ( )
setThrowsExceptionIfLifetimeIsNegative ( )
setThrowsExceptionIfLifetimeIsNotNullOrAnInteger ( )
setUp ( )
protected

Set up this testcase

Definition at line 50 of file RedisBackendTest.php.

setUpBackend ( array  $backendOptions = [])
protected

Sets up the redis backend used for testing

Parameters
array$backendOptionsOptions for the redis backend

Definition at line 69 of file RedisBackendTest.php.

Referenced by RedisBackendTest\collectGarbageDoesNotRemoveNotExpiredIdentifierToDataEntry(), RedisBackendTest\collectGarbageRemovesExpiredIdentifierFromTagsToIdentifierSet(), RedisBackendTest\collectGarbageRemovesLeftOverIdentifierToTagsSet(), RedisBackendTest\findIdentifiersByTagReturnsAllIdentifiersTagedWithSpecifiedTag(), RedisBackendTest\findIdentifiersByTagReturnsEmptyArrayForNotExistingTag(), RedisBackendTest\findIdentifiersByTagThrowsExceptionIfTagIsNotAString(), RedisBackendTest\flushByTagDoesNotRemoveIdentifierToTagsSetOfUnrelatedEntry(), RedisBackendTest\flushByTagRemovesEntriesTaggedWithSpecifiedTag(), RedisBackendTest\flushByTagRemovesIdentifiersTaggedWithGivenTagFromTagToIdentifiersSets(), RedisBackendTest\flushByTagRemovesIdentifierToTagsSetOfEntryTaggedWithGivenTag(), RedisBackendTest\flushByTagRemovesTagToIdentifiersSetOfGivenTag(), RedisBackendTest\flushByTagRemovesTemporarySet(), RedisBackendTest\flushByTagsRemovesEntriesTaggedWithSpecifiedTags(), RedisBackendTest\flushByTagThrowsExceptionIfTagIsNotAString(), RedisBackendTest\flushRemovesAllEntriesFromCache(), RedisBackendTest\getReturnsPreviouslyCompressedSetEntry(), RedisBackendTest\getReturnsPreviouslySetEntry(), RedisBackendTest\getThrowsExceptionIfIdentifierIsNotAString(), RedisBackendTest\hasReturnsFalseForNotExistingEntry(), RedisBackendTest\hasReturnsTrueForPreviouslySetEntry(), RedisBackendTest\hasThrowsExceptionIfIdentifierIsNotAString(), RedisBackendTest\initializeObjectThrowsNoExceptionIfGivenDatabaseWasSuccessfullySelected(), RedisBackendTest\removeDeletesEntryFromCache(), RedisBackendTest\removeDeletesIdentifierFromTagToIdentifiersSet(), RedisBackendTest\removeDeletesIdentifierFromTagToIdentifiersSetWithMultipleEntries(), RedisBackendTest\removeDeletesIdentifierToTagEntry(), RedisBackendTest\removeReturnsFalseIfNoEntryWasDeleted(), RedisBackendTest\removeReturnsTrueIfAnEntryWasDeleted(), RedisBackendTest\removeThrowsExceptionIfIdentifierIsNotAString(), RedisBackendTest\setAddsIdentifierInTagToIdentifiersEntryIfTagIsAddedOnConsecutiveSet(), RedisBackendTest\setAppendsSecondIdentifierInTagToIdentifiersEntry(), RedisBackendTest\setCompressionLevelThrowsExceptionIfCompressionLevelIsNotBetweenMinusOneAndNine(), RedisBackendTest\setCompressionLevelThrowsExceptionIfCompressionLevelIsNotInteger(), RedisBackendTest\setCompressionThrowsExceptionIfCompressionParameterIsNotOfTypeBoolean(), RedisBackendTest\setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNegative(), RedisBackendTest\setDatabaseThrowsExceptionIfGivenDatabaseNumberIsNotAnInteger(), RedisBackendTest\setOverwritesExistingEntryWithNewData(), RedisBackendTest\setOverwritesExistingEntryWithNewDefaultLifetime(), RedisBackendTest\setOverwritesExistingEntryWithNewUnlimitedLifetime(), RedisBackendTest\setOverwritesExistingEntryWithSpecifiedLifetime(), RedisBackendTest\setRemovesAllPreviouslySetTagsFromIdentifierToTagsSet(), RedisBackendTest\setRemovesIdentifierFromTagToIdentifiersEntryIfTagIsOmittedOnConsecutiveSet(), RedisBackendTest\setRemovesMultiplePreviouslySetTagsFromIdentifierToTagsSet(), RedisBackendTest\setSavesCompressedDataWithEnabledCompression(), RedisBackendTest\setSavesEntryWithDefaultLifeTime(), RedisBackendTest\setSavesEntryWithSpecifiedLifeTime(), RedisBackendTest\setSavesEntryWithUnlimitedLifeTime(), RedisBackendTest\setSavesIdentifierInTagToIdentifiersSetOfSpecifiedTag(), RedisBackendTest\setSavesPlaintextDataWithEnabledCompressionAndCompressionLevel0(), RedisBackendTest\setSavesSetDataTypeForIdentifierToTagsSet(), RedisBackendTest\setSavesSetDataTypeForTagToIdentifiersSet(), RedisBackendTest\setSavesSpecifiedTagsInIdentifierToTagsSet(), RedisBackendTest\setSavesStringDataTypeForIdentifierToDataEntry(), RedisBackendTest\setStoresEntriesInSelectedDatabase(), RedisBackendTest\setThrowsExceptionIfDataIsNotAString(), RedisBackendTest\setThrowsExceptionIfIdentifierIsNotAString(), RedisBackendTest\setThrowsExceptionIfLifetimeIsNegative(), and RedisBackendTest\setThrowsExceptionIfLifetimeIsNotNullOrAnInteger().

setUpRedis ( )
protected

Sets up an own redis instance for implementation tests

Definition at line 81 of file RedisBackendTest.php.

Referenced by RedisBackendTest\collectGarbageDoesNotRemoveNotExpiredIdentifierToDataEntry(), RedisBackendTest\collectGarbageRemovesExpiredIdentifierFromTagsToIdentifierSet(), RedisBackendTest\collectGarbageRemovesLeftOverIdentifierToTagsSet(), RedisBackendTest\flushByTagDoesNotRemoveIdentifierToTagsSetOfUnrelatedEntry(), RedisBackendTest\flushByTagRemovesIdentifiersTaggedWithGivenTagFromTagToIdentifiersSets(), RedisBackendTest\flushByTagRemovesIdentifierToTagsSetOfEntryTaggedWithGivenTag(), RedisBackendTest\flushByTagRemovesTagToIdentifiersSetOfGivenTag(), RedisBackendTest\flushByTagRemovesTemporarySet(), RedisBackendTest\flushRemovesAllEntriesFromCache(), RedisBackendTest\removeDeletesIdentifierFromTagToIdentifiersSet(), RedisBackendTest\removeDeletesIdentifierFromTagToIdentifiersSetWithMultipleEntries(), RedisBackendTest\removeDeletesIdentifierToTagEntry(), RedisBackendTest\setAddsIdentifierInTagToIdentifiersEntryIfTagIsAddedOnConsecutiveSet(), RedisBackendTest\setAppendsSecondIdentifierInTagToIdentifiersEntry(), RedisBackendTest\setOverwritesExistingEntryWithNewDefaultLifetime(), RedisBackendTest\setOverwritesExistingEntryWithNewUnlimitedLifetime(), RedisBackendTest\setOverwritesExistingEntryWithSpecifiedLifetime(), RedisBackendTest\setRemovesAllPreviouslySetTagsFromIdentifierToTagsSet(), RedisBackendTest\setRemovesIdentifierFromTagToIdentifiersEntryIfTagIsOmittedOnConsecutiveSet(), RedisBackendTest\setRemovesMultiplePreviouslySetTagsFromIdentifierToTagsSet(), RedisBackendTest\setSavesCompressedDataWithEnabledCompression(), RedisBackendTest\setSavesEntryWithDefaultLifeTime(), RedisBackendTest\setSavesEntryWithSpecifiedLifeTime(), RedisBackendTest\setSavesEntryWithUnlimitedLifeTime(), RedisBackendTest\setSavesIdentifierInTagToIdentifiersSetOfSpecifiedTag(), RedisBackendTest\setSavesPlaintextDataWithEnabledCompressionAndCompressionLevel0(), RedisBackendTest\setSavesSetDataTypeForIdentifierToTagsSet(), RedisBackendTest\setSavesSetDataTypeForTagToIdentifiersSet(), RedisBackendTest\setSavesSpecifiedTagsInIdentifierToTagsSet(), RedisBackendTest\setSavesStringDataTypeForIdentifierToDataEntry(), and RedisBackendTest\setStoresEntriesInSelectedDatabase().

tearDown ( )
protected

Tear down this testcase

Definition at line 90 of file RedisBackendTest.php.

Member Data Documentation

$backend = null
protected

Definition at line 38 of file RedisBackendTest.php.

$redis = null
protected

Definition at line 45 of file RedisBackendTest.php.