TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest:
TYPO3\CMS\Core\Tests\UnitTestCase TYPO3\CMS\Core\Tests\BaseTestCase

Public Member Functions

 setUp ()
 
 tearDown ()
 
 classesFromSubDirectoriesAreLoaded ()
 
 classesFromDeeplyNestedSubDirectoriesAreLoaded ()
 
 classesFromSubMatchingPackagesAreLoaded ()
 
 classesWithUnderscoresAreLoaded ()
 
 namespaceWithUnderscoresAreLoaded ()
 
 classesWithOnlyUnderscoresAreLoaded ()
 
 classesWithLeadingBackslashAreLoaded ()
 

Static Public Attributes

static $testClassWasLoaded = FALSE
 

Protected Member Functions

 createFakeExtension ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 getAccessibleMock ( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
 
 getAccessibleMockForAbstractClass ( $originalClassName, array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix='')
 

Protected Attributes

 $typo3CacheManager = NULL
 
 $fakedExtensions = array()
 
 $classLoader
 
 $orinalClassAliasMap
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 $backupGlobalsBlacklist = array('TYPO3_LOADED_EXT')
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 $backupGlobals = TRUE
 
 $backupStaticAttributes = FALSE
 

Detailed Description

Testcase for TYPO3

Author
Andreas Wolf andre.nosp@m.as.w.nosp@m.olf@i.nosp@m.kt-w.nosp@m.erk.d.nosp@m.e

Definition at line 24 of file ClassLoaderTest.php.

Member Function Documentation

◆ classesFromDeeplyNestedSubDirectoriesAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesFromDeeplyNestedSubDirectoriesAreLoaded ( )
Test:

Definition at line 123 of file ClassLoaderTest.php.

◆ classesFromSubDirectoriesAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesFromSubDirectoriesAreLoaded ( )

Checks if the package autoloader loads classes from subdirectories.

Test:

Definition at line 111 of file ClassLoaderTest.php.

◆ classesFromSubMatchingPackagesAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesFromSubMatchingPackagesAreLoaded ( )

Checks if the package autoloader loads classes from packages that match a substring of another package (e.g. TYPO3CR vs TYPO3).

Test:

Definition at line 138 of file ClassLoaderTest.php.

◆ classesWithLeadingBackslashAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesWithLeadingBackslashAreLoaded ( )
Test:

Definition at line 192 of file ClassLoaderTest.php.

◆ classesWithOnlyUnderscoresAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesWithOnlyUnderscoresAreLoaded ( )

Checks if the package autoloader loads classes from subdirectories.

Test:

Definition at line 180 of file ClassLoaderTest.php.

◆ classesWithUnderscoresAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::classesWithUnderscoresAreLoaded ( )

Checks if the package autoloader loads classes from subdirectories.

Test:

Definition at line 152 of file ClassLoaderTest.php.

◆ createFakeExtension()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::createFakeExtension ( )
protected

Creates a fake extension inside typo3temp/. No configuration is created, just the folder, plus the extension is registered in $TYPO3_LOADED_EXT

Returns
string The extension key

Definition at line 93 of file ClassLoaderTest.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\clearExtensionKeyMap(), TYPO3\CMS\Core\Tests\BaseTestCase\getUniqueId(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir().

◆ namespaceWithUnderscoresAreLoaded()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::namespaceWithUnderscoresAreLoaded ( )

Checks if the package autoloader loads classes from subdirectories with underscores.

Test:

Definition at line 166 of file ClassLoaderTest.php.

◆ setUp()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::setUp ( )

Fix a race condition that GeneralUtility is not available during tearDown if fiddling with the autoloader where backupGlobals is not set up again yet

Definition at line 58 of file ClassLoaderTest.php.

References TYPO3\CMS\Core\Core\Bootstrap\getInstance().

◆ tearDown()

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::tearDown ( )

The class alias map is kept static in the class loader for legacy reasons and has to be reset after mocking.

Definition at line 82 of file ClassLoaderTest.php.

Member Data Documentation

◆ $classLoader

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::$classLoader
protected

Definition at line 39 of file ClassLoaderTest.php.

◆ $fakedExtensions

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::$fakedExtensions = array()
protected

Definition at line 34 of file ClassLoaderTest.php.

◆ $orinalClassAliasMap

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::$orinalClassAliasMap
protected

Definition at line 44 of file ClassLoaderTest.php.

◆ $testClassWasLoaded

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::$testClassWasLoaded = FALSE
static

Definition at line 51 of file ClassLoaderTest.php.

◆ $typo3CacheManager

TYPO3\CMS\Core\Tests\Unit\Core\ClassLoaderTest::$typo3CacheManager = NULL
protected

Definition at line 29 of file ClassLoaderTest.php.