TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
LocalizationUtilityTest Class Reference
Inheritance diagram for LocalizationUtilityTest:
UnitTestCase 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 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

 $configurationManagerMock
 
 $LOCAL_LANG
 
- 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 LocalizationUtilityTest.php.

Member Function Documentation

clearLabelWithTypoScript ( )
implodeTypoScriptLabelArrayWorks ( )
Test:

Definition at line 189 of file LocalizationUtilityTest.php.

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 ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

loadTypoScriptLabelsProvider ( )
Returns
array

Definition at line 299 of file LocalizationUtilityTest.php.

setUp ( )
protected

Prepare class mocking some dependencies

Definition at line 152 of file LocalizationUtilityTest.php.

References BaseTestCase\getAccessibleMock().

tearDown ( )
protected

Reset static properties

Definition at line 165 of file LocalizationUtilityTest.php.

translateDataProvider ( )
Returns
array

Definition at line 234 of file LocalizationUtilityTest.php.

References LocalizationUtilityTest\$LOCAL_LANG.

translateForEmptyStringKeyReturnsNull ( )
Test:

Definition at line 218 of file LocalizationUtilityTest.php.

References LocalizationUtility\translate().

translateForEmptyStringKeyWithArgumentsReturnsNull ( )
Test:

Definition at line 226 of file LocalizationUtilityTest.php.

References LocalizationUtility\translate().

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 LocalizationUtility\translate().

Member Data Documentation

$configurationManagerMock
protected

Definition at line 29 of file LocalizationUtilityTest.php.

$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 LocalizationUtilityTest\translateDataProvider().