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

Public Member Functions

 getInstanceReturnsInstanceOfSimpleClass ()
 
 getInstanceReturnsInstanceOfSimpleNamespacedClass ()
 
 getInstanceReturnsInstanceOfAClassWithConstructorInjection ()
 
 getInstanceReturnsInstanceOfAClassWithTwoLevelDependency ()
 
 getInstanceReturnsInstanceOfAClassWithMixedSimpleTypeAndConstructorInjection ()
 
 getInstanceReturnsInstanceOfAClassWithMixedSimpleTypeAndConstructorInjectionWithNullDefaultValue ()
 
 getInstanceThrowsExceptionWhenTryingToInstanciateASingletonWithConstructorParameters ()
 
 getInstanceReturnsInstanceOfAClassWithConstructorInjectionAndDefaultConstructorParameters ()
 
 getInstancePassesGivenParameterToTheNewObject ()
 
 getInstanceReturnsAFreshInstanceIfObjectIsNoSingleton ()
 
 getInstanceReturnsSameInstanceInstanceIfObjectIsSingleton ()
 
 getInstanceThrowsExceptionIfPrototypeObjectsWiredViaConstructorInjectionContainCyclicDependencies ()
 
 getInstanceThrowsExceptionIfPrototypeObjectsWiredViaSetterInjectionContainCyclicDependencies ()
 
 getInstanceThrowsExceptionIfClassWasNotFound ()
 
 getInstanceUsesClassNameMd5AsCacheKey ()
 
 getInstanceInitializesObjects ()
 
 setClassInfoCacheCallback ($id,\TYPO3\CMS\Extbase\Object\Container\ClassInfo $value)
 
 getEmptyObjectReturnsInstanceOfSimpleClass ()
 
 getEmptyObjectReturnsInstanceOfClassImplementingSerializable ()
 
 getEmptyObjectInitializesObjects ()
 
 test_canGetChildClass ()
 
 test_canInjectInterfaceInClass ()
 
 test_canBuildCyclicDependenciesOfSingletonsWithSetter ()
 
 singletonWhichRequiresPrototypeViaSetterInjectionWorksAndAddsDebugMessage ()
 
 singletonWhichRequiresSingletonViaSetterInjectionWorks ()
 
 prototypeWhichRequiresPrototypeViaSetterInjectionWorks ()
 
 prototypeWhichRequiresSingletonViaSetterInjectionWorks ()
 
 singletonWhichRequiresPrototypeViaConstructorInjectionWorksAndAddsDebugMessage ()
 
 singletonWhichRequiresSingletonViaConstructorInjectionWorks ()
 
 prototypeWhichRequiresPrototypeViaConstructorInjectionWorks ()
 
 prototypeWhichRequiresSingletonViaConstructorInjectionWorks ()
 
 isSingletonReturnsTrueForSingletonInstancesAndFalseForPrototypes ()
 
 isPrototypeReturnsFalseForSingletonInstancesAndTrueForPrototypes ()
 
 getInstanceGivesSimpleConstructorArgumentToClassInstance ()
 
 getInstanceDoesNotInfluenceSimpleTypeConstructorArgumentIfNotGiven ()
 
 getInstanceGivesExistingConstructorArgumentToClassInstance ()
 
 getInstanceInjectsNewInstanceOfClassToClassIfArgumentIsMandatory ()
 
 getInstanceDoesNotInjectAnOptionalArgumentIfNotGiven ()
 
 getInstanceDoesNotInjectAnOptionalArgumentIfGivenArgumentIsNull ()
 
 getInstanceGivesExistingConstructorArgumentToClassInstanceIfArgumentIsGiven ()
 
 getInstanceGivesTwoArgumentsToClassConstructor ()
 
 getInstanceInjectsTwoMandatoryArguments ()
 
 getInstanceInjectsSecondMandatoryArgumentIfFirstIsGiven ()
 
 getInstanceInjectsFirstMandatoryArgumentIfSecondIsGiven ()
 
 getInstanceGivesTwoArgumentsToClassConstructorIfSecondIsOptional ()
 
 getInstanceInjectsFirstMandatoryArgumentIfSecondIsOptionalAndNoneAreGiven ()
 
 getInstanceInjectsFirstMandatoryArgumentIfSecondIsOptionalAndBothAreGivenAsNull ()
 
 getInstanceGivesFirstArgumentToConstructorIfSecondIsOptionalAndFirstIsGiven ()
 
 getInstanceGivesFirstArgumentToConstructorIfSecondIsOptionalFirstIsGivenAndSecondIsGivenNull ()
 
 getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGivenAsNull ()
 
 getInstanceOnFirstOptionalAndSecondMandatoryGivesTwoGivenArgumentsToConstructor ()
 
 getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGiven ()
 
 getInstanceOnFirstOptionalAndSecondMandatoryGivesSecondArgumentAsIsIfFirstIsGivenAsNullAndSecondIsGiven ()
 
 getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGivenAsNullAndSecondIsNull ()
 
 getInstanceOnTwoOptionalGivesTwoGivenArgumentsToConstructor ()
 
 getInstanceOnTwoOptionalGivesNoArgumentsToConstructorIfArgumentsAreNull ()
 
 getInstanceOnTwoOptionalGivesNoArgumentsToConstructorIfNoneAreGiven ()
 
 getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsObjectAndSecondIsNotGiven ()
 
 getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsObjectAndSecondIsNull ()
 
 getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsNullAndSecondIsObject ()
 

Protected Member Functions

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

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

Detailed Description

Test case

Definition at line 22 of file ContainerTest.php.

Member Function Documentation

getEmptyObjectInitializesObjects ( )
Test:

Definition at line 252 of file ContainerTest.php.

getEmptyObjectReturnsInstanceOfClassImplementingSerializable ( )
Test:

Definition at line 243 of file ContainerTest.php.

getEmptyObjectReturnsInstanceOfSimpleClass ( )
Test:

Definition at line 234 of file ContainerTest.php.

getInstanceDoesNotInfluenceSimpleTypeConstructorArgumentIfNotGiven ( )

test class SimpleTypeConstructorArgument

Test:

Definition at line 408 of file ContainerTest.php.

getInstanceDoesNotInjectAnOptionalArgumentIfGivenArgumentIsNull ( )

test class OptionalConstructorArgument

Test:

Definition at line 473 of file ContainerTest.php.

getInstanceDoesNotInjectAnOptionalArgumentIfNotGiven ( )

test class OptionalConstructorArgument

Test:

Definition at line 457 of file ContainerTest.php.

getInstanceGivesExistingConstructorArgumentToClassInstance ( )

test class MandatoryConstructorArgument

Test:

Definition at line 420 of file ContainerTest.php.

getInstanceGivesExistingConstructorArgumentToClassInstanceIfArgumentIsGiven ( )

test class OptionalConstructorArgument

Test:

Definition at line 490 of file ContainerTest.php.

getInstanceGivesFirstArgumentToConstructorIfSecondIsOptionalAndFirstIsGiven ( )

test class TwoConstructorArgumentsSecondOptional

Test:

Definition at line 690 of file ContainerTest.php.

getInstanceGivesFirstArgumentToConstructorIfSecondIsOptionalFirstIsGivenAndSecondIsGivenNull ( )

test class TwoConstructorArgumentsSecondOptional

Test:

Definition at line 712 of file ContainerTest.php.

getInstanceGivesSimpleConstructorArgumentToClassInstance ( )

test class SimpleTypeConstructorArgument

Test:

Definition at line 395 of file ContainerTest.php.

getInstanceGivesTwoArgumentsToClassConstructor ( )

test class MandatoryConstructorArgumentTwo

Test:

Definition at line 508 of file ContainerTest.php.

getInstanceGivesTwoArgumentsToClassConstructorIfSecondIsOptional ( )

test class TwoConstructorArgumentsSecondOptional

Test:

Definition at line 623 of file ContainerTest.php.

getInstanceInitializesObjects ( )
Test:

Definition at line 213 of file ContainerTest.php.

getInstanceInjectsFirstMandatoryArgumentIfSecondIsGiven ( )

test class MandatoryConstructorArgumentTwo

Test:

Definition at line 590 of file ContainerTest.php.

getInstanceInjectsFirstMandatoryArgumentIfSecondIsOptionalAndBothAreGivenAsNull ( )

test class TwoConstructorArgumentsSecondOptional

Test:

Definition at line 669 of file ContainerTest.php.

getInstanceInjectsFirstMandatoryArgumentIfSecondIsOptionalAndNoneAreGiven ( )

test class TwoConstructorArgumentsSecondOptional

Test:

Definition at line 649 of file ContainerTest.php.

getInstanceInjectsNewInstanceOfClassToClassIfArgumentIsMandatory ( )

test class MandatoryConstructorArgument

Test:

Definition at line 438 of file ContainerTest.php.

getInstanceInjectsSecondMandatoryArgumentIfFirstIsGiven ( )

test class MandatoryConstructorArgumentTwo

Test:

Definition at line 561 of file ContainerTest.php.

getInstanceInjectsTwoMandatoryArguments ( )

test class MandatoryConstructorArgumentTwo

Test:

Definition at line 534 of file ContainerTest.php.

getInstanceOnFirstOptionalAndSecondMandatoryGivesSecondArgumentAsIsIfFirstIsGivenAsNullAndSecondIsGiven ( )

test class TwoConstructorArgumentsFirstOptional

Test:

Definition at line 811 of file ContainerTest.php.

getInstanceOnFirstOptionalAndSecondMandatoryGivesTwoGivenArgumentsToConstructor ( )

test class TwoConstructorArgumentsFirstOptional

Test:

Definition at line 755 of file ContainerTest.php.

getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGiven ( )

test class TwoConstructorArgumentsFirstOptional

Test:

Definition at line 781 of file ContainerTest.php.

getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGivenAsNull ( )

test class TwoConstructorArgumentsFirstOptional

Test:

Definition at line 735 of file ContainerTest.php.

getInstanceOnFirstOptionalAndSecondMandatoryInjectsSecondArgumentIfFirstIsGivenAsNullAndSecondIsNull ( )

test class TwoConstructorArgumentsFirstOptional

Test:

Definition at line 833 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesNoArgumentsToConstructorIfArgumentsAreNull ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 879 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesNoArgumentsToConstructorIfNoneAreGiven ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 897 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsNullAndSecondIsObject ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 957 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsObjectAndSecondIsNotGiven ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 913 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesOneArgumentToConstructorIfFirstIsObjectAndSecondIsNull ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 935 of file ContainerTest.php.

getInstanceOnTwoOptionalGivesTwoGivenArgumentsToConstructor ( )

test class TwoConstructorArgumentsBothOptional

Test:

Definition at line 853 of file ContainerTest.php.

getInstancePassesGivenParameterToTheNewObject ( )
Test:

Definition at line 130 of file ContainerTest.php.

getInstanceReturnsAFreshInstanceIfObjectIsNoSingleton ( )
Test:

Definition at line 141 of file ContainerTest.php.

getInstanceReturnsInstanceOfAClassWithConstructorInjection ( )
Test:

Definition at line 69 of file ContainerTest.php.

getInstanceReturnsInstanceOfAClassWithConstructorInjectionAndDefaultConstructorParameters ( )
Test:

Definition at line 119 of file ContainerTest.php.

getInstanceReturnsInstanceOfAClassWithMixedSimpleTypeAndConstructorInjection ( )
Test:

Definition at line 89 of file ContainerTest.php.

getInstanceReturnsInstanceOfAClassWithMixedSimpleTypeAndConstructorInjectionWithNullDefaultValue ( )
Test:

Definition at line 99 of file ContainerTest.php.

getInstanceReturnsInstanceOfAClassWithTwoLevelDependency ( )
Test:

Definition at line 79 of file ContainerTest.php.

getInstanceReturnsInstanceOfSimpleClass ( )
Test:

Definition at line 51 of file ContainerTest.php.

getInstanceReturnsInstanceOfSimpleNamespacedClass ( )
Test:

Definition at line 60 of file ContainerTest.php.

getInstanceReturnsSameInstanceInstanceIfObjectIsSingleton ( )
Test:

Definition at line 151 of file ContainerTest.php.

getInstanceThrowsExceptionIfClassWasNotFound ( )
Test:

Definition at line 181 of file ContainerTest.php.

getInstanceThrowsExceptionIfPrototypeObjectsWiredViaConstructorInjectionContainCyclicDependencies ( )
Test:

Definition at line 161 of file ContainerTest.php.

getInstanceThrowsExceptionIfPrototypeObjectsWiredViaSetterInjectionContainCyclicDependencies ( )
Test:

Definition at line 171 of file ContainerTest.php.

getInstanceThrowsExceptionWhenTryingToInstanciateASingletonWithConstructorParameters ( )
Test:

Definition at line 109 of file ContainerTest.php.

getInstanceUsesClassNameMd5AsCacheKey ( )
Test:

Definition at line 191 of file ContainerTest.php.

References ContainerTest\$container.

isPrototypeReturnsFalseForSingletonInstancesAndTrueForPrototypes ( )
Test:

Definition at line 381 of file ContainerTest.php.

isSingletonReturnsTrueForSingletonInstancesAndFalseForPrototypes ( )
Test:

Definition at line 372 of file ContainerTest.php.

prototypeWhichRequiresPrototypeViaConstructorInjectionWorks ( )
Test:

Definition at line 352 of file ContainerTest.php.

prototypeWhichRequiresPrototypeViaSetterInjectionWorks ( )
Test:

Definition at line 312 of file ContainerTest.php.

prototypeWhichRequiresSingletonViaConstructorInjectionWorks ( )
Test:

Definition at line 362 of file ContainerTest.php.

prototypeWhichRequiresSingletonViaSetterInjectionWorks ( )
Test:

Definition at line 322 of file ContainerTest.php.

setClassInfoCacheCallback (   $id,
\TYPO3\CMS\Extbase\Object\Container\ClassInfo  $value 
)

Callback for getInstanceUsesClassNameSha1AsCacheKey

Parameters
string$id
\TYPO3\CMS\Extbase\Object\Container\ClassInfo$value
Returns
void

Definition at line 226 of file ContainerTest.php.

setUp ( )
protected

Definition at line 34 of file ContainerTest.php.

singletonWhichRequiresPrototypeViaConstructorInjectionWorksAndAddsDebugMessage ( )
Test:

Definition at line 332 of file ContainerTest.php.

singletonWhichRequiresPrototypeViaSetterInjectionWorksAndAddsDebugMessage ( )
Test:

Definition at line 292 of file ContainerTest.php.

singletonWhichRequiresSingletonViaConstructorInjectionWorks ( )
Test:

Definition at line 342 of file ContainerTest.php.

singletonWhichRequiresSingletonViaSetterInjectionWorks ( )
Test:

Definition at line 302 of file ContainerTest.php.

test_canBuildCyclicDependenciesOfSingletonsWithSetter ( )
Test:

Definition at line 282 of file ContainerTest.php.

test_canGetChildClass ( )
Test:

Definition at line 261 of file ContainerTest.php.

test_canInjectInterfaceInClass ( )
Test:

Definition at line 270 of file ContainerTest.php.

Member Data Documentation

$cachedClassInfo
protected

Definition at line 32 of file ContainerTest.php.

$container
protected