‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest:
TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase

Public Member Functions

 defaultLanguageConfigurationDataProvider ()
 
 onlyEnglishContentIsRenderedForDefaultLanguage (string $typoScript, string $sysLanguageMode, string $sysLanguageContentOL)
 
array dutchDataProvider ()
 
 renderingOfDutchLanguage (string $typoScript, array $visibleRecords, string $sysLanguageMode, string $sysLanguageContentOL)
 
 contentOnNonTranslatedPageDataProvider ()
 
 contentOnNonTranslatedPageGerman (string $typoScript, array $visibleRecords, string $pageTitle, int $sysLanguageUid, int $sysLanguageContent, string $sysLanguageMode, string $sysLanguageContentOL, int $statusCode=200)
 
 contentOnPartiallyTranslatedPageDataProvider ()
 
 contentOnPartiallyTranslatedPage (string $typoScript, array $visibleHeaders, string $sysLanguageMode, string $sysLanguageContentOL)
 

Public Attributes

const VALUE_PageId = 89
 
const TABLE_Content = 'tt_content'
 
const TABLE_Pages = 'pages'
 
- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
const VALUE_BackendUserId = 1
 

Protected Member Functions

 setUp ()
 
array getNonVisibleHeaders (array $visibleHeaders)
 
array getNonVisibleFileTitles (array $visibleTitles)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
 tearDown ()
 
 setWorkspaceId (int $workspaceId)
 
ActionService getActionService ()
 
 importScenarioDataSet ($dataSetName)
 
 assertAssertionDataSet ($dataSetName)
 
 assertErrorLogEntries ()
 
HasRecordConstraint getRequestSectionHasRecordConstraint ()
 
DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint ()
 
StructureHasRecordConstraint getRequestSectionStructureHasRecordConstraint ()
 
StructureDoesNotHaveRecordConstraint getRequestSectionStructureDoesNotHaveRecordConstraint ()
 

Protected Attributes

string $scenarioDataSetDirectory = 'typo3/sysext/frontend/Tests/Functional/Rendering/DataSet/'
 
array $configurationToUseInTestInstance
 
array $pathsToLinkInTestInstance
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
string $scenarioDataSetDirectory
 
string $assertionDataSetDirectory
 
int null $expectedErrorLogEntries = 0
 
array $testExtensionsToLoad
 
array $pathsToLinkInTestInstance
 
array $recordIds = array( )
 
ActionService $actionService
 
TYPO3 CMS Core Authentication BackendUserAuthentication $backendUser
 

Detailed Description

Test case checking if localized tt_content is rendered correctly with different language settings

The following values are relevant:

– TypoScript – config.sys_language_uid = [0,1,2,3,4...] (set via the language parameter &L=1 from the FrontendRequest in the tests) Fetch the page overlay of the current page if the value is > 0 and if not available, then "config.sys_language_mode" is evaluated. If this setting is set to "0" or empty, then no page overlay is evaluated, and no further parameters are relevant or evaluated.

config.sys_language_mode = [strict, content_fallback;2,3, ignore] Only evaluated when sys_language_uid > 0, and the requested page translation is NOT available. Decides if "pageNotFound" (strict), "content_fallback" with a fallback chain ($TSFE->sys_language_content is set to that value) or "ignore" (just render the page and the content as this translation would exist). When set to "0" or not set "", this means that the page request is using the default language for content and page properties. Content fallback is evaluated on page level, not on the CE level. So it only makes a difference when the page translation for the requested language does not exist.

config.sys_language_overlay = [0, 1, hideNonTranslated] Only relevant if $TSFE->sys_language_content is > 0. Sets the property $TSFE->sys_language_contentOL at a request. Further calls via $TSFE->sys_page->getRecordOverlay receive this value to see if an overlay should happen. 0: Just fetch records from selected ($TSFE->sys_language_content) language, no overlay will happen, no fetching of the records from the default language. This boils down to "free mode" language handling.

1: Fetch records from the default language and overlay them with translations. If some record is not translated default language version will be shown.

hideNotTranslated: Fetch records from the default language and overlay them with translations. If some record is not translated it will not be shown.

Frontend / TypoScriptFrontendController –

$TSFE->sys_language_uid Defines in which language the current page was requested, this is relevant when building menus or links to other pages. $TSFE->sys_language_content Contains the language UID of the content records that should be overlaid to would be fetched. This is especially useful when a page requested with language=4 should fall back to showing content of language=2 (see config.sys_language_mode=content_fallback) $TSFE->sys_language_contentOL Contains the info if and how record overlays (when fetching content) should be handled, either "0" (no overlays done) or "1" (do overlays with possible mixed content, or "hideNonTranslated". see "config.sys_language_overlay" This is used in conjunction with $TSFE->sys_language_content. $TSFE->sys_language_mode Contains the config.sys_language_mode parameter, which is either "", "strict", "content_fallback" or "ignore" Only used within $TSFE->settingLanguage() and in Extbase.

Definition at line 75 of file LocalizedContentRenderingTest.php.

Member Function Documentation

◆ contentOnNonTranslatedPageDataProvider()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::contentOnNonTranslatedPageDataProvider ( )

Definition at line 646 of file LocalizedContentRenderingTest.php.

◆ contentOnNonTranslatedPageGerman()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::contentOnNonTranslatedPageGerman ( string  $typoScript,
array  $visibleRecords,
string  $pageTitle,
int  $sysLanguageUid,
int  $sysLanguageContent,
string  $sysLanguageMode,
string  $sysLanguageContentOL,
int  $statusCode = 200 
)

◆ contentOnPartiallyTranslatedPage()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::contentOnPartiallyTranslatedPage ( string  $typoScript,
array  $visibleHeaders,
string  $sysLanguageMode,
string  $sysLanguageContentOL 
)

Page uid 89 is translated to to Polish, but not all CE are translated

Test:
‪@dataProvider contentOnPartiallyTranslatedPageDataProvider
Parameters
string$typoScript
array$visibleHeaders
string$sysLanguageMode
string$sysLanguageContentOL

Definition at line 1157 of file LocalizedContentRenderingTest.php.

References TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest\getNonVisibleHeaders(), TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint(), and TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint().

◆ contentOnPartiallyTranslatedPageDataProvider()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::contentOnPartiallyTranslatedPageDataProvider ( )

Definition at line 1024 of file LocalizedContentRenderingTest.php.

◆ defaultLanguageConfigurationDataProvider()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::defaultLanguageConfigurationDataProvider ( )

Definition at line 114 of file LocalizedContentRenderingTest.php.

◆ dutchDataProvider()

array TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::dutchDataProvider ( )

Dutch language has page translation record and some content elements are translated

Returns
‪array

Definition at line 276 of file LocalizedContentRenderingTest.php.

◆ getNonVisibleFileTitles()

array TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::getNonVisibleFileTitles ( array  $visibleTitles)
protected

◆ getNonVisibleHeaders()

◆ onlyEnglishContentIsRenderedForDefaultLanguage()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::onlyEnglishContentIsRenderedForDefaultLanguage ( string  $typoScript,
string  $sysLanguageMode,
string  $sysLanguageContentOL 
)

◆ renderingOfDutchLanguage()

◆ setUp()

TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::setUp ( )
protected

Member Data Documentation

◆ $configurationToUseInTestInstance

array TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::$configurationToUseInTestInstance
protected
Initial value:
= array(
'FE' => [
'pageNotFound_handling' => 'READFILE:typo3/sysext/frontend/Tests/Functional/Rendering/DataSet/404Template.html'
]
)

Custom 404 handler returning valid json is registered so the $this->getFrontendResponse() does not fail on 404 pages

Definition at line 90 of file LocalizedContentRenderingTest.php.

◆ $pathsToLinkInTestInstance

array TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::$pathsToLinkInTestInstance
protected
Initial value:
= array(
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/AdditionalConfiguration.php' => 'typo3conf/AdditionalConfiguration.php',
'typo3/sysext/frontend/Tests/Functional/Fixtures/Images' => 'fileadmin/user_upload'
)

Definition at line 98 of file LocalizedContentRenderingTest.php.

◆ $scenarioDataSetDirectory

string TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::$scenarioDataSetDirectory = 'typo3/sysext/frontend/Tests/Functional/Rendering/DataSet/'
protected

Definition at line 83 of file LocalizedContentRenderingTest.php.

◆ TABLE_Content

const TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::TABLE_Content = 'tt_content'

Definition at line 78 of file LocalizedContentRenderingTest.php.

◆ TABLE_Pages

const TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::TABLE_Pages = 'pages'

Definition at line 79 of file LocalizedContentRenderingTest.php.

◆ VALUE_PageId

const TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest::VALUE_PageId = 89

Definition at line 77 of file LocalizedContentRenderingTest.php.