‪TYPO3CMS  10.4
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

ConfigurationManagerInterface $configurationManagerInterfaceProphecy
 
array $LOCAL_LANG = array( )
 
string $languageFilePath = ''
 

Detailed Description

Test case

Definition at line 34 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 217 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 458 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 56 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 188 of file LocalizationUtilityTest.php.

◆ translateDataProvider()

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

Definition at line 264 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 305 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 336 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

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

Instance of configurationManagerInterface, injected to subject

Definition at line 40 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 51 of file LocalizationUtilityTest.php.

◆ $LOCAL_LANG

array TYPO3\CMS\Extbase\Tests\Unit\Utility\LocalizationUtilityTest::$LOCAL_LANG = array( )
protected