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

Public Member Functions

 implodeTypoScriptLabelArrayWorks ()
 
 translateForEmptyStringKeyReturnsNull ()
 
 translateForEmptyStringKeyWithArgumentsReturnsNull ()
 
 translateDataProvider ()
 
 translateTest ($key, array $LOCAL_LANG, $languageKey, $expected, array $altLanguageKeys=[], array $arguments=null)
 
 loadTypoScriptLabelsProvider ()
 
 loadTypoScriptLabels (array $LOCAL_LANG, array $typoScriptLocalLang, $languageKey, array $expected)
 
 clearLabelWithTypoScript ()
 

Protected Member Functions

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

Protected Attributes

 $configurationManagerMock
 
 $LOCAL_LANG
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Test case

Definition at line 22 of file LocalizationUtilityTest.php.

Member Function Documentation

◆ clearLabelWithTypoScript()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::clearLabelWithTypoScript ( )

◆ implodeTypoScriptLabelArrayWorks()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::implodeTypoScriptLabelArrayWorks ( )
Test:

Definition at line 189 of file LocalizationUtilityTest.php.

◆ loadTypoScriptLabels()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::loadTypoScriptLabels ( array  $LOCAL_LANG,
array  $typoScriptLocalLang,
  $languageKey,
array  $expected 
)

Tests whether labels from xml are overwritten by TypoScript labels

Parameters
array$LOCAL_LANG
array$typoScriptLocalLang
string$languageKey
array$expected
Returns
void loadTypoScriptLabelsProvider
Test:

Definition at line 399 of file LocalizationUtilityTest.php.

References TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

◆ loadTypoScriptLabelsProvider()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::loadTypoScriptLabelsProvider ( )
Returns
array

Definition at line 299 of file LocalizationUtilityTest.php.

◆ setUp()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::setUp ( )
protected

Prepare class mocking some dependencies

Definition at line 152 of file LocalizationUtilityTest.php.

References TYPO3\CMS\Core\Tests\BaseTestCase\getAccessibleMock().

◆ tearDown()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::tearDown ( )
protected

Reset static properties

Definition at line 165 of file LocalizationUtilityTest.php.

◆ translateDataProvider()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateDataProvider ( )

◆ translateForEmptyStringKeyReturnsNull()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateForEmptyStringKeyReturnsNull ( )

◆ translateForEmptyStringKeyWithArgumentsReturnsNull()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateForEmptyStringKeyWithArgumentsReturnsNull ( )

◆ translateTest()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateTest (   $key,
array  $LOCAL_LANG,
  $languageKey,
  $expected,
array  $altLanguageKeys = [],
array  $arguments = null 
)
Parameters
string$key
array$LOCAL_LANG
string$languageKey
string$expected
array$altLanguageKeys
array$arguments
Returns
void translateDataProvider
Test:

Definition at line 277 of file LocalizationUtilityTest.php.

References TYPO3\CMS\Extbase\Utility\LocalizationUtility\translate().

Member Data Documentation

◆ $configurationManagerMock

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$configurationManagerMock
protected

Definition at line 29 of file LocalizationUtilityTest.php.

◆ $LOCAL_LANG

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$LOCAL_LANG
protected
Initial value:
= [
'extensionKey' => [
'default' => [
'key1' => [
[
'source' => 'English label for key1',
'target' => 'English label for key1'

Definition at line 36 of file LocalizationUtilityTest.php.

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest\translateDataProvider().