‪TYPO3CMS  11.5
TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest:

Public Member Functions

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

Protected Member Functions

 setUp ()
 
 tearDown ()
 
string getLanguageFilePath (string $extensionName)
 

Protected Attributes

ObjectProphecy $configurationManagerInterfaceProphecy
 
array $LOCAL_LANG = []
 
string $languageFilePath = ''
 

Detailed Description

Test case

Definition at line 39 of file LocalizationUtilityTest.php.

Member Function Documentation

◆ clearLabelWithTypoScript()

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

◆ getLanguageFilePath()

string TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::getLanguageFilePath ( string  $extensionName)
protected

◆ implodeTypoScriptLabelArrayWorks()

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

Definition at line 235 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‪@dataProvider loadTypoScriptLabelsProvider
Test:

Definition at line 484 of file LocalizationUtilityTest.php.

References TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest\$LOCAL_LANG, and TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

◆ loadTypoScriptLabelsProvider()

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

◆ setUp()

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

Prepare class mocking some dependencies

Definition at line 62 of file LocalizationUtilityTest.php.

References TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest\getLanguageFilePath().

◆ tearDown()

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

Reset static properties

Definition at line 206 of file LocalizationUtilityTest.php.

◆ translateDataProvider()

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

Definition at line 282 of file LocalizationUtilityTest.php.

◆ translateForEmptyStringKeyReturnsNull()

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

◆ translateForEmptyStringKeyWithArgumentsReturnsNull()

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

◆ translateTestWithBackendUserLanguage()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateTestWithBackendUserLanguage (   $key,
  $languageKey,
  $expected,
array  $altLanguageKeys = [],
array  $arguments = null 
)
Parameters
string$key
string$languageKey
string$expected
array$altLanguageKeys
array$arguments‪@dataProvider translateDataProvider
Test:

Definition at line 329 of file LocalizationUtilityTest.php.

References $GLOBALS, TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest\$LOCAL_LANG, and TYPO3\CMS\Extbase\Utility\LocalizationUtility\translate().

◆ translateTestWithExplicitLanguageParameters()

TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::translateTestWithExplicitLanguageParameters (   $key,
  $languageKey,
  $expected,
array  $altLanguageKeys = [],
array  $arguments = null 
)
Parameters
string$key
string$languageKey
string$expected
array$altLanguageKeys
array$arguments‪@dataProvider translateDataProvider
Test:

Definition at line 361 of file LocalizationUtilityTest.php.

References $GLOBALS, and TYPO3\CMS\Extbase\Utility\LocalizationUtility\translate().

◆ translateThrowsExceptionWithEmptyExtensionNameIfKeyIsNotPrefixedWithLLL()

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

◆ translateWillReturnLabelsFromTsEvenIfNoXlfFileExists()

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

Member Data Documentation

◆ $configurationManagerInterfaceProphecy

ObjectProphecy TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$configurationManagerInterfaceProphecy
protected

Definition at line 47 of file LocalizationUtilityTest.php.

◆ $languageFilePath

string TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$languageFilePath = ''
protected

File path of locallang for extension "core"

Definition at line 57 of file LocalizationUtilityTest.php.

◆ $LOCAL_LANG

array TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$LOCAL_LANG = []
protected