Commit 2776cef8 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[TASK] Switch functional tests to site handling

All functional tests that run a frontend subrequest
should be tested against Site Handling, as the
PseudoSite Handling is about to removed.

This patch is actually a precursor to make sure
that all tests work with site handling now.

The AbstractDataHandlerActionTestCase adds
e site configuration on each setUp(). This
way, all DataHandler-related tests are running
with a Site configuration of three languages.

In addition, when "localizing" something,
a translated page needs to exist, so most
DataHandler related changes add this functionality.

For some DataHandler tests, the SiteConfiguration
is adapted to define the previous behavior
built in TypoScript.

One addition in PageResolver is made:
If an GET / POST &id query parameter is given,
and it is not accessible, it will fail now.

Resolves: #88357
Releases: master
Change-Id: I3dafec3382d8c6797f32b3acde2763dacd13e0f3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60757

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 617f0633
......@@ -17,16 +17,14 @@ namespace TYPO3\CMS\Backend\Tests\Functional\Controller\Page;
*/
use TYPO3\CMS\Backend\Controller\Page\LocalizationController;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService;
use TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase;
/**
* Test case for TYPO3\CMS\Backend\Controller\Page\LocalizationController
*/
class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
{
/**
* @var string
......@@ -38,11 +36,6 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional
*/
protected $subject;
/**
* @var \TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService
*/
protected $actionService;
/**
* @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
*/
......@@ -60,15 +53,11 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional
{
parent::setUp();
$this->backendUser = $this->setUpBackendUserFromFixture(1);
$this->backendUser->workspace = 0;
Bootstrap::initializeLanguageObject();
$this->actionService = GeneralUtility::makeInstance(ActionService::class);
$this->importDataSet(__DIR__ . '/Fixtures/pages.xml');
$this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/sys_language.xml');
$this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/backend/Tests/Functional/Controller/Page/Fixtures/tt_content-default-language.xml');
$this->setUpFrontendRootPage(1);
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->subject = $this->getMockBuilder(LocalizationController::class)
->setMethods(['getPageColumns'])
......@@ -305,14 +294,4 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional
return $recordLocalizeSummary['records'];
}
/**
* @param string $dataSetName
*/
protected function assertAssertionDataSet(string $dataSetName)
{
$fileName = rtrim($this->assertionDataSetDirectory, '/') . '/' . $dataSetName . '.csv';
$fileName = GeneralUtility::getFileAbsFileName($fileName);
$this->assertCSVDataSet($fileName);
}
}
......@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Core\Tests\Functional\DataHandling;
* The TYPO3 project - inspiring people to share!
*/
use Symfony\Component\Yaml\Yaml;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\WorkspaceAspect;
use TYPO3\CMS\Core\Core\Bootstrap;
......@@ -80,6 +82,37 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
*/
protected $backendUser;
/**
* Default Site Configuration
* @var array
*/
protected $siteLanguageConfiguration = [
1 => [
'title' => 'Dansk',
'enabled' => true,
'languageId' => 1,
'base' => '/dk/',
'typo3Language' => 'dk',
'locale' => 'da_DK.UTF-8',
'iso-639-1' => 'da',
'flag' => 'dk',
'fallbackType' => 'fallback',
'fallbacks' => '0'
],
2 => [
'title' => 'Deutsch',
'enabled' => true,
'languageId' => 2,
'base' => '/de/',
'typo3Language' => 'de',
'locale' => 'de_DE.UTF-8',
'iso-639-1' => 'de',
'flag' => 'de',
'fallbackType' => 'fallback',
'fallbacks' => '1,0'
],
];
protected function setUp(): void
{
parent::setUp();
......@@ -100,6 +133,49 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
parent::tearDown();
}
/**
* Create a simple site config for the tests that
* call a frontend page.
*
* @param int $pageId
* @param array $additionalLanguages
*/
protected function setUpFrontendSite(int $pageId, array $additionalLanguages = [])
{
$languages = [
0 => [
'title' => 'English',
'enabled' => true,
'languageId' => 0,
'base' => '/',
'typo3Language' => 'default',
'locale' => 'en_US.UTF-8',
'iso-639-1' => 'en',
'navigationTitle' => '',
'hreflang' => '',
'direction' => '',
'flag' => 'us',
]
];
$languages = array_merge($languages, $additionalLanguages);
$configuration = [
'rootPageId' => $pageId,
'base' => '/',
'languages' => $languages,
'errorHandling' => [],
'routes' => [],
];
GeneralUtility::mkdir_deep($this->instancePath . '/typo3conf/sites/testing/');
$yamlFileContents = Yaml::dump($configuration, 99, 2);
$fileName = $this->instancePath . '/typo3conf/sites/testing/config.yaml';
GeneralUtility::writeFile($fileName, $yamlFileContents);
// Ensure that no other site configuration was cached before
$cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
if ($cache->has('site-configuration')) {
$cache->remove('site-configuration');
}
}
/**
* @param int $workspaceId
*/
......
......@@ -54,6 +54,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultElements');
$this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/sys_file_storage.xml');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
}
......
......@@ -86,13 +86,14 @@ class ActionTest extends AbstractActionTestCase
*/
public function copyContentToLanguage()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyContentToLanguage();
$this->assertAssertionDataSet('copyContentToLanguage');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[1]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #2'));
......@@ -108,6 +109,8 @@ class ActionTest extends AbstractActionTestCase
*/
public function localizeContent()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeContent();
$this->assertAssertionDataSet('localizeContent');
......
......@@ -48,6 +48,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultElements');
$this->importScenarioDataSet('ReferenceIndex');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
}
......
......@@ -241,13 +241,16 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Abs
*/
public function copyContentToLanguageOfRelation()
{
// Create translated page first
$this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyContentToLanguageOfRelation();
$this->assertAssertionDataSet('copyContentToLanguageOfRelation');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentElement)
......@@ -322,6 +325,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Abs
*/
public function localizeElementOfRelation()
{
// Create translated page first
$this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeElementOfRelation();
$this->assertAssertionDataSet('localizeElementOfRelation');
......
......@@ -4,6 +4,7 @@
,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",,,
,89,88,256,0,0,0,0,0,0,0,"Relations",,,
,90,88,512,0,0,0,0,0,0,0,"Target",,,
,91,88,256,0,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
"tt_content",,,,,,,,,,,,,,
,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group"
,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"
......
......@@ -4,6 +4,7 @@
,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",,,
,89,88,256,0,0,0,0,0,0,0,"Relations",,,
,90,88,512,0,0,0,0,0,0,0,"Target",,,
,91,88,256,0,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
"tt_content",,,,,,,,,,,,,,
,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group"
,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"
......
......@@ -50,6 +50,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultPages');
$this->importScenarioDataSet('LiveDefaultElements');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
}
......
......@@ -109,14 +109,18 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
*/
public function copyParentContentToLanguageWithAllChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyParentContentToLanguage();
$this->assertAssertionDataSet('copyParentContentToLanguage');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default');
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
......@@ -128,6 +132,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
*/
public function localizeParentContentWithAllChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentWithAllChildren();
$this->assertAssertionDataSet('localizeParentContentWAllChildren');
......@@ -143,6 +150,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
*/
public function localizeParentContentWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeParentContentLanguageSynchronization');
......@@ -314,6 +324,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
*/
public function createAndLocalizeParentContentWithHotelAndOfferChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
$this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
......
......@@ -55,6 +55,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultPages');
$this->importScenarioDataSet('LiveDefaultElements');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(
1,
[
......
......@@ -109,14 +109,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function copyParentContentToLanguageWithAllChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyParentContentToLanguageWithAllChildren();
$this->assertAssertionDataSet('copyParentContentToLanguageWAllChildren');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel)
......@@ -129,6 +130,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentWithAllChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentWithAllChildren();
$this->assertAssertionDataSet('localizeParentContentWAllChildren');
......@@ -144,6 +147,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeParentContentSynchronization');
......@@ -159,6 +164,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentChainLanguageSynchronizationSource()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
parent::localizeParentContentChainLanguageSynchronizationSource();
$this->assertAssertionDataSet('localizeParentContentChainLanguageSynchronizationSource');
......@@ -174,6 +182,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeParentContentNCreateNestedChildrenWLanguageSynchronization');
......@@ -189,6 +199,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization();
// the assertion is the same as for localizeParentContentWithLanguageSynchronization()
$this->assertAssertionDataSet('localizeParentContentSynchronization');
......@@ -205,6 +217,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization();
// the assertion is the same as for localizeParentContentWithLanguageSynchronization()
$this->assertAssertionDataSet('localizeParentContentSynchronization');
......@@ -377,6 +391,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function createAndLocalizeParentContentWithHotelAndOfferChildren()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
$this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
......@@ -397,6 +413,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
*/
public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
$this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
......
......@@ -48,6 +48,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultPages');
$this->importScenarioDataSet('LiveDefaultElements');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
}
......
......@@ -278,6 +278,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMan
*/
public function localizeCategoryOfRelation()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeCategoryOfRelation();
$this->assertAssertionDataSet('localizeCategoryOfRelation');
......
......@@ -45,6 +45,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->importScenarioDataSet('LiveDefaultPages');
$this->importScenarioDataSet('LiveDefaultElements');
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
$this->setWorkspaceId(0);
}
......
......@@ -48,6 +48,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function createContentForLanguageAll()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
parent::createContentForLanguageAll();
$this->assertAssertionDataSet('createContentForLanguageAll');
......@@ -121,13 +124,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function copyContentToLanguage()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyContentToLanguage();
$this->assertAssertionDataSet('copyContentToLanguage');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
......@@ -139,13 +144,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function copyContentToLanguageWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyContentToLanguageWithLanguageSynchronization();
$this->assertAssertionDataSet('copyContentToLanguageWSynchronization');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
......@@ -157,13 +164,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function copyContentToLanguageWithLocalizationExclude()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::copyContentToLanguageWithLocalizationExclude();
$this->assertAssertionDataSet('copyContentToLanguageWExclude');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "dk" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #3', 'Regular Element #2 (copy 1)'));
......@@ -175,13 +184,16 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function copyContentToLanguageFromNonDefaultLanguage()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
parent::copyContentToLanguageFromNonDefaultLanguage();
$this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript'
]);
// Set up "de" to not have overlays
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[self::VALUE_LanguageIdSecond]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
......@@ -207,6 +219,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function localizeContent()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeContent();
$this->assertAssertionDataSet('localizeContent');
......@@ -222,6 +236,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function localizeContentWithEmptyTcaIntegrityColumns()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeContentWithEmptyTcaIntegrityColumns();
$this->assertAssertionDataSet('localizeContent');
......@@ -236,6 +252,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
*/
public function localizeContentWithLanguageSynchronization()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeContentWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeContentWSynchronization');
......@@ -250,6 +268,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A