[TASK] Switch functional tests to site handling 57/60757/4
authorBenni Mack <benni@typo3.org>
Wed, 15 May 2019 08:01:26 +0000 (10:01 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 15 May 2019 10:25:58 +0000 (12:25 +0200)
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: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
60 files changed:
typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php
typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/FAL/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/copyContentToLanguageOfRelation.csv
typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSiteTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv
typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript [deleted file]
typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php
typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php
typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml
typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php
typo3/sysext/frontend/Classes/Middleware/PageResolver.php
typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml
typo3/sysext/frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript
typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php
typo3/sysext/frontend/Tests/Functional/Rendering/TitleTagRenderingTest.php
typo3/sysext/frontend/Tests/Functional/Rendering/UriPrefixRenderingTest.php
typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/SlugScenario.yaml
typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/DataSet/localizeElementOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/DataSet/localizeElementOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/DataSet/localizeElementOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/DataSet/localizeElementOfRelation.csv

index b362128..0c08826 100644 (file)
@@ -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
@@ -39,11 +37,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
      */
     protected $backendUser;
@@ -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);
-    }
 }
index 4185358..605607c 100644 (file)
@@ -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();
@@ -101,6 +134,49 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
     }
 
     /**
+     * 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
      */
     protected function setWorkspaceId(int $workspaceId)
index 74165b0..e7e256a 100644 (file)
@@ -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']);
     }
 
index 674a9d4..04bbec6 100644 (file)
@@ -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');
 
index d7ec994..1c7d3b1 100644 (file)
@@ -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']);
     }
 
index 88ee453..bdccf2c 100644 (file)
@@ -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');
 
index 22e6092..ca4765e 100644 (file)
@@ -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"
index d4d8e58..f70ff3d 100644 (file)
@@ -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"
index 41e1a0e..6e7620f 100644 (file)
@@ -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']);
     }
 
index 814ab5c..7b14ec6 100644 (file)
@@ -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');
 
index ae682c0..2ae5130 100644 (file)
@@ -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,
             [
index f969b78..a57624b 100644 (file)
@@ -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');
 
index 5a0e89c..ad0aa64 100644 (file)
@@ -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']);
     }
 
index f2a0f0b..115e993 100644 (file)
@@ -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');
 
index 8cc48c7..be75531 100644 (file)
@@ -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);
     }
index 3714975..8a64f24 100644 (file)
@@ -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
      */
     public function localizeContentWithLanguageSynchronizationHavingNullValue()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeContentWithLanguageSynchronizationHavingNullValue();
         $this->assertAssertionDataSet('localizeContentWSynchronizationHNull');
 
@@ -264,6 +284,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
      */
     public function localizeContentFromNonDefaultLanguage()
     {
+        // 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::localizeContentFromNonDefaultLanguage();
 
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
@@ -279,6 +302,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
      */
     public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault()
     {
+        // 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::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault();
 
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationDefault');
@@ -294,6 +320,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
      */
     public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource()
     {
+        // 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::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource();
 
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationSource');
@@ -309,6 +338,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
      */
     public function createLocalizedContent()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createLocalizedContent();
 
         $this->assertAssertionDataSet('createLocalizedContent');
@@ -324,6 +355,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
      */
     public function createLocalizedContentWithLanguageSynchronization()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createLocalizedContentWithLanguageSynchronization();
 
         $this->assertAssertionDataSet('createLocalizedContentWSynchronization');
index d5fe222..cbe32a7 100644 (file)
@@ -48,6 +48,7 @@ class MultiSiteTest extends AbstractDataHandlerActionTestCase
         $this->importScenarioDataSet('LiveDefaultElements');
 
         $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
+        $this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
     }
 
     /**
index d20d271..657978d 100644 (file)
@@ -47,6 +47,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']);
     }
 
index e5a7d0a..0bf40d6 100644 (file)
@@ -287,6 +287,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Select\Ab
      */
     public function localizeElementOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeElementOfRelation();
         $this->assertAssertionDataSet('localizeElementOfRelation');
 
index c024c2a..330bcbe 100644 (file)
@@ -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_select"
 ,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"
diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript b/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript
deleted file mode 100644 (file)
index ea34270..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-config {
-       sys_language_overlay = 0
-}
\ No newline at end of file
index 55dfeb8..9be09d8 100644 (file)
@@ -45,6 +45,7 @@ class EnableFieldsTest extends AbstractDataHandlerActionTestCase
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.xml');
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.xml');
 
+        $this->setUpFrontendSite(1);
         $this->setUpFrontendRootPage(1, ['typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/JsonRenderer.typoscript']);
     }
 
index 99c2150..0673b57 100644 (file)
@@ -14,11 +14,20 @@ namespace TYPO3\CMS\Fluid\Tests\Functional\View;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
 class TemplatesPathsTest extends FunctionalTestCase
 {
+    use SiteBasedTestTrait;
+
+    /**
+     * @var array
+     */
+    protected const LANGUAGE_PRESETS = [
+        'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'],
+    ];
     /**
      * @var array
      */
@@ -68,6 +77,16 @@ class TemplatesPathsTest extends FunctionalTestCase
         parent::setUp();
 
         $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml');
+        $this->writeSiteConfiguration(
+            'test',
+            $this->buildSiteConfiguration(1, 'https://website.local/'),
+            [
+                $this->buildDefaultLanguageConfiguration('EN', '/en/'),
+            ],
+            [
+                $this->buildErrorHandlingConfiguration('Fluid', [404])
+            ]
+        );
         $this->setUpFrontendRootPage(1, ['EXT:fluid_test/Configuration/TypoScript/Basic.ts']);
     }
 
@@ -298,7 +317,7 @@ class TemplatesPathsTest extends FunctionalTestCase
     protected function fetchFrontendResponseBody(array $requestArguments): string
     {
         $response = $this->executeFrontendRequest(
-            (new InternalRequest())->withQueryParameters($requestArguments)
+            (new InternalRequest('https://website.local/en/'))->withQueryParameters($requestArguments)
         );
 
         return (string)$response->getBody();
index 117accc..2c84e0b 100644 (file)
@@ -2,6 +2,7 @@
 <dataset>
        <pages>
                <uid>1</uid>
-               <title>Seitentitel</title>
+               <title>Root Page Title</title>
+               <slug>/</slug>
        </pages>
-</dataset>
\ No newline at end of file
+</dataset>
index 83ba4d5..482ae66 100644 (file)
@@ -15,10 +15,26 @@ namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 
 class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
 {
+    use SiteBasedTestTrait;
+
+    /**
+     * @var array
+     */
+    protected const LANGUAGE_PRESETS = [
+        'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'],
+    ];
+
+    protected $configurationToUseInTestInstance = [
+        'FE' => [
+            'encryptionKey' => '12345'
+        ]
+    ];
+
     /**
      * @var array
      */
@@ -34,7 +50,16 @@ class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\Fun
         parent::setUp();
 
         $this->importDataSet('typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml');
-
+        $this->writeSiteConfiguration(
+            'test',
+            $this->buildSiteConfiguration(1, '/'),
+            [
+                $this->buildDefaultLanguageConfiguration('EN', '/en/'),
+            ],
+            [
+                $this->buildErrorHandlingConfiguration('Fluid', [404])
+            ]
+        );
         $_GET = [
             'foo' => 'bar',
             'temp' => 'test',
@@ -79,56 +104,56 @@ class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'addQueryString' => false,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => '',
-                'expected' => '<a href="index.php?id=1">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>',
+                'expected' => '<a href="/en/">This is a testlink</a> <a href="/en/">This is a testlink</a>',
                 'template' => 'link_typolink_viewhelper',
             ],
             'link: with add query string' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => '',
-                'expected' => '<a href="index.php?id=1&amp;foo=bar&amp;temp=test">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>',
+                'expected' => '<a href="/en/?foo=bar&amp;temp=test&amp;cHash=286759dfcd3f566fa21091a0d77e9831">This is a testlink</a> <a href="/en/">This is a testlink</a>',
                 'template' => 'link_typolink_viewhelper',
             ],
             'link: with add query string and exclude' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => 'temp',
-                'expected' => '<a href="index.php?id=1&amp;foo=bar">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>',
+                'expected' => '<a href="/en/?foo=bar&amp;cHash=afa4b37588ab917af3cfe2cd4464029d">This is a testlink</a> <a href="/en/">This is a testlink</a>',
                 'template' => 'link_typolink_viewhelper',
             ],
             'link: with add query string and method POST' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'POST',
                 'addQueryStringExclude' => 'temp',
-                'expected' => '<a href="index.php?id=1">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>',
+                'expected' => '<a href="/en/">This is a testlink</a> <a href="/en/">This is a testlink</a>',
                 'template' => 'link_typolink_viewhelper',
             ],
             'uri: default' => [
                 'addQueryString' => false,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => '',
-                'expected' => 'index.php?id=1 index.php?id=1',
+                'expected' => '/en/ /en/',
                 'template' => 'uri_typolink_viewhelper',
             ],
             'uri: with add query string' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => '',
-                'expected' => 'index.php?id=1&amp;foo=bar&amp;temp=test index.php?id=1',
+                'expected' => '/en/?foo=bar&amp;temp=test&amp;cHash=286759dfcd3f566fa21091a0d77e9831 /en/',
                 'template' => 'uri_typolink_viewhelper',
             ],
             'uri: with add query string and exclude' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'GET',
                 'addQueryStringExclude' => 'temp',
-                'expected' => 'index.php?id=1&amp;foo=bar index.php?id=1',
+                'expected' => '/en/?foo=bar&amp;cHash=afa4b37588ab917af3cfe2cd4464029d /en/',
                 'template' => 'uri_typolink_viewhelper',
             ],
             'uri: with add query string and method POST' => [
                 'addQueryString' => true,
                 'addQueryStringMethod' => 'POST',
                 'addQueryStringExclude' => 'temp',
-                'expected' => 'index.php?id=1 index.php?id=1',
+                'expected' => '/en/ /en/',
                 'template' => 'uri_typolink_viewhelper',
             ],
         ];
index 508ad4b..9507d34 100644 (file)
@@ -87,15 +87,23 @@ class PageResolver implements MiddlewareInterface
             }
 
             $requestId = (string)($request->getQueryParams()['id'] ?? '');
-            if (!empty($requestId) && !empty($page = $this->resolvePageId($requestId))) {
+            if (!empty($requestId)) {
                 // Legacy URIs (?id=12345) takes precedence, not matter if a route is given
-                $pageArguments = new PageArguments(
-                    (int)($page['l10n_parent'] ?: $page['uid']),
-                    (string)($request->getQueryParams()['type'] ?? '0'),
-                    [],
-                    [],
-                    $request->getQueryParams()
-                );
+                if (!empty($page = $this->resolvePageId($requestId))) {
+                    $pageArguments = new PageArguments(
+                        (int)($page['l10n_parent'] ?: $page['uid']),
+                        (string)($request->getQueryParams()['type'] ?? '0'),
+                        [],
+                        [],
+                        $request->getQueryParams()
+                    );
+                } else {
+                    return GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
+                        $request,
+                        'The requested page does not exist',
+                        ['code' => PageAccessFailureReasons::PAGE_NOT_FOUND]
+                    );
+                }
             } else {
                 // Check for the route
                 try {
index 0870a5d..687fe77 100644 (file)
@@ -5,6 +5,7 @@
         <pid>0</pid>
         <title>Root 1</title>
         <deleted>0</deleted>
+        <slug>/</slug>
         <perms_everybody>15</perms_everybody>
     </pages>
     <pages>
index 9951a52..bb2a865 100644 (file)
@@ -730,7 +730,7 @@ class LocalizedSiteContentRenderingTest extends \TYPO3\CMS\Core\Tests\Functional
 
         //Expected behaviour:
         //Setting sys_language_mode to different values doesn't influence the result as the requested page is translated to Polish,
-        //Page title is always [PL]Page, and both sys_language_content and sys_language_uid are always 3
+        //Page title is always [PL]Page, and both languageId/contentId are always 3
         return [
             [
                 'languageConfiguration' => [
index 7671ace..1e5b69c 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\Rendering;
  * The TYPO3 project - inspiring people to share!
  */
 
+use Symfony\Component\Yaml\Yaml;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
@@ -48,12 +49,48 @@ class TitleTagRenderingTest extends FunctionalTestCase
             1,
             ['EXT:frontend/Tests/Functional/Rendering/Fixtures/TitleTagRenderingTest.typoscript']
         );
+        $this->setUpFrontendSite(1);
         $this->setSiteTitleToTemplateRecord(
             1,
             'Site Title'
         );
     }
 
+    /**
+     * Create a simple site config for the tests that
+     * call a frontend page.
+     *
+     * @param int $pageId
+     */
+    protected function setUpFrontendSite(int $pageId)
+    {
+        $configuration = [
+            'rootPageId' => $pageId,
+            'base' => '/',
+            'languages' => [
+                [
+                    'title' => 'English',
+                    'enabled' => true,
+                    'languageId' => '0',
+                    'base' => '/',
+                    'typo3Language' => 'default',
+                    'locale' => 'en_US.UTF-8',
+                    'iso-639-1' => 'en',
+                    'navigationTitle' => '',
+                    'hreflang' => '',
+                    'direction' => '',
+                    'flag' => 'us',
+                ]
+            ],
+            '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);
+    }
+
     public function titleTagDataProvider(): array
     {
         return [
index 3297d3f..5f3f9dd 100644 (file)
@@ -3,13 +3,29 @@ declare(strict_types = 1);
 
 namespace TYPO3\CMS\Frontend\Tests\Functional\Rendering;
 
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
 class UriPrefixRenderingTest extends FunctionalTestCase
 {
+    use SiteBasedTestTrait;
+
     /**
      * @var string[]
      */
@@ -23,7 +39,6 @@ class UriPrefixRenderingTest extends FunctionalTestCase
         'extensionJS' => 'EXT:core/Resources/Public/JavaScript/Contrib/jquery.autocomplete.js',
         'externalJS' => 'https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js',
         'localImage' => 'typo3/sysext/frontend/Resources/Public/Icons/Extension.png',
-        'localLink' => '1',
     ];
 
     /**
@@ -37,7 +52,6 @@ class UriPrefixRenderingTest extends FunctionalTestCase
         'extensionJS' => 'typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery.autocomplete.js',
         'externalJS' => 'https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js',
         'localImage' => 'typo3/sysext/frontend/Resources/Public/Icons/Extension.png',
-        'localLink' => 'index.php?id=1',
     ];
 
     /**
@@ -54,10 +68,24 @@ class UriPrefixRenderingTest extends FunctionalTestCase
         'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/AdditionalConfiguration.php' => 'typo3conf/AdditionalConfiguration.php',
     ];
 
+    protected const LANGUAGE_PRESETS = [
+        'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8', 'iso' => 'en', 'hrefLang' => 'en-US'],
+    ];
+
     protected function setUp(): void
     {
         parent::setUp();
         $this->importDataSet('EXT:frontend/Tests/Functional/Fixtures/pages.xml');
+        $this->writeSiteConfiguration(
+            'test',
+            $this->buildSiteConfiguration(1, '/'),
+            [
+                $this->buildDefaultLanguageConfiguration('EN', '/en/'),
+            ],
+            [
+                $this->buildErrorHandlingConfiguration('Fluid', [404])
+            ]
+        );
         $this->setUpFrontendRootPage(
             1,
             ['EXT:frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript']
@@ -320,7 +348,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase
                     [
                         preg_quote($candidate, '#'),
                         preg_quote($pathInfo['filename'], '#'),
-                        preg_quote($pathInfo['extension'], '#'),
+                        preg_quote($pathInfo['extension'] ?? '', '#'),
                     ],
                     $expectation
                 );
index d58412a..8bb31e0 100644 (file)
@@ -134,7 +134,7 @@ entities:
             - self: {id: 3110, title: 'EN: Markets', slug: '/archive/markets'}
             - self: {id: 3120, title: 'EN: Products', slug: '/archive/products'}
             - self: {id: 3130, title: 'EN: Partners', slug: '/archive/partners'}
-    - self: {id: 7000, title: 'Common Collection', type: *pageFolder, slug: '/common'}
+    - self: {id: 7000, title: 'Common Collection', type: *pageFolder, root: true, slug: '/common'}
       children:
         - self: {id: 7100, title: 'Announcements & News', slug: '/common/news'}
           children:
index c57fd35..ddb7426 100644 (file)
@@ -84,6 +84,19 @@ class SlugLinkGeneratorTest extends AbstractTestCase
             'jane-blog-acme-com',
             $this->buildSiteConfiguration(2120, 'https://blog.acme.com/jane/')
         );
+        $this->writeSiteConfiguration(
+            'archive-acme-com',
+            $this->buildSiteConfiguration(3000, 'https://archive.acme.com/'),
+            [
+                $this->buildDefaultLanguageConfiguration('EN', '/'),
+                $this->buildLanguageConfiguration('FR', 'https://archive.acme.com/fr/', ['EN']),
+                $this->buildLanguageConfiguration('FR-CA', 'https://archive.acme.com/ca/', ['FR', 'EN'])
+            ]
+        );
+        $this->writeSiteConfiguration(
+            'common-collection',
+            $this->buildSiteConfiguration(7000, 'https://common.acme.com/')
+        );
 
         $this->withDatabaseSnapshot(function () {
             $this->setUpDatabase();
@@ -288,11 +301,11 @@ class SlugLinkGeneratorTest extends AbstractTestCase
             ['https://acme.us/', 1100, 1411, 0, 'https://acme.fr/acme-dans-votre-region/groupes'],
             ['https://acme.us/', 1100, 1412, 0, 'https://acme.ca/acme-dans-votre-quebec/groupes'],
             // acme.com -> archive (outside site)
-            ['https://acme.us/', 1100, 3100, 0, '/index.php?id=3100&L=0'],
-            ['https://acme.us/', 1100, 3100, 1, '/index.php?id=3100&L=1'],
-            ['https://acme.us/', 1100, 3100, 2, '/index.php?id=3100&L=2'],
-            ['https://acme.us/', 1100, 3101, 0, '/index.php?id=3100&L=1'],
-            ['https://acme.us/', 1100, 3102, 0, '/index.php?id=3100&L=2'],
+            ['https://acme.us/', 1100, 3100, 0, 'https://archive.acme.com/archive/statistics'],
+            ['https://acme.us/', 1100, 3100, 1, 'https://archive.acme.com/fr/archive/statistics'],
+            ['https://acme.us/', 1100, 3100, 2, 'https://archive.acme.com/ca/archive/statistics'],
+            ['https://acme.us/', 1100, 3101, 0, 'https://archive.acme.com/fr/archive/statistics'],
+            ['https://acme.us/', 1100, 3102, 0, 'https://archive.acme.com/ca/archive/statistics'],
             // blog.acme.com -> acme.com (different site)
             ['https://blog.acme.com/', 2100, 1100, 0, 'https://acme.us/welcome'],
             ['https://blog.acme.com/', 2100, 1100, 1, 'https://acme.fr/bienvenue'],
@@ -300,11 +313,11 @@ class SlugLinkGeneratorTest extends AbstractTestCase
             ['https://blog.acme.com/', 2100, 1101, 0, 'https://acme.fr/bienvenue'],
             ['https://blog.acme.com/', 2100, 1102, 0, 'https://acme.ca/bienvenue'],
             // blog.acme.com -> archive (outside site)
-            ['https://blog.acme.com/', 2100, 3100, 0, '/index.php?id=3100&L=0'],
-            ['https://blog.acme.com/', 2100, 3100, 1, '/index.php?id=3100&L=1'],
-            ['https://blog.acme.com/', 2100, 3100, 2, '/index.php?id=3100&L=2'],
-            ['https://blog.acme.com/', 2100, 3101, 0, '/index.php?id=3100&L=1'],
-            ['https://blog.acme.com/', 2100, 3102, 0, '/index.php?id=3100&L=2'],
+            ['https://blog.acme.com/', 2100, 3100, 0, 'https://archive.acme.com/archive/statistics'],
+            ['https://blog.acme.com/', 2100, 3100, 1, 'https://archive.acme.com/fr/archive/statistics'],
+            ['https://blog.acme.com/', 2100, 3100, 2, 'https://archive.acme.com/ca/archive/statistics'],
+            ['https://blog.acme.com/', 2100, 3101, 0, 'https://archive.acme.com/fr/archive/statistics'],
+            ['https://blog.acme.com/', 2100, 3102, 0, 'https://archive.acme.com/ca/archive/statistics'],
             // blog.acme.com -> products.acme.com (different sub-site)
             ['https://blog.acme.com/', 2100, 1300, 0, 'https://products.acme.com/products'],
             ['https://blog.acme.com/', 2100, 1310, 0, 'https://products.acme.com/products/planets'],
@@ -344,33 +357,6 @@ class SlugLinkGeneratorTest extends AbstractTestCase
     }
 
     /**
-     * @param string $hostPrefix
-     * @param int $sourcePageId
-     * @param int $targetPageId
-     * @param int $targetLanguageId
-     * @param string $expectation
-     *
-     * @test
-     * @dataProvider linkIsGeneratedForLanguageDataProvider
-     */
-    public function linkIsGeneratedForLanguageWithLegacyProperty(string $hostPrefix, int $sourcePageId, int $targetPageId, int $targetLanguageId, string $expectation)
-    {
-        $response = $this->executeFrontendRequest(
-            (new InternalRequest($hostPrefix))
-                ->withPageId($sourcePageId)
-                ->withInstructions([
-                    $this->createTypoLinkUrlInstruction([
-                        'parameter' => $targetPageId,
-                        'additionalParams' => '&L=' . $targetLanguageId,
-                    ])
-                ]),
-            $this->internalRequestContext
-        );
-
-        static::assertSame($expectation, (string)$response->getBody());
-    }
-
-    /**
      * @return array
      */
     public function linkIsGeneratedWithQueryParametersDataProvider(): array
@@ -706,15 +692,15 @@ class SlugLinkGeneratorTest extends AbstractTestCase
                         'children' => [
                             [
                                 'title' => 'Markets',
-                                'link' => '/index.php?id=7110&MP=7100-1700',
+                                'link' => 'https://common.acme.com/common/markets?MP=7100-1700',
                             ],
                             [
                                 'title' => 'Products',
-                                'link' => '/index.php?id=7120&MP=7100-1700',
+                                'link' => 'https://common.acme.com/common/products?MP=7100-1700',
                             ],
                             [
                                 'title' => 'Partners',
-                                'link' => '/index.php?id=7130&MP=7100-1700',
+                                'link' => 'https://common.acme.com/common/partners?MP=7100-1700',
                             ],
                         ],
                     ],
@@ -747,15 +733,15 @@ class SlugLinkGeneratorTest extends AbstractTestCase
                             'children' => [
                                 [
                                     'title' => 'Markets',
-                                    'link' => '/index.php?id=7110&MP=7100-2700',
+                                    'link' => 'https://common.acme.com/common/markets?MP=7100-2700',
                                 ],
                                 [
                                     'title' => 'Products',
-                                    'link' => '/index.php?id=7120&MP=7100-2700',
+                                    'link' => 'https://common.acme.com/common/products?MP=7100-2700',
                                 ],
                                 [
                                     'title' => 'Partners',
-                                    'link' => '/index.php?id=7130&MP=7100-2700',
+                                    'link' => 'https://common.acme.com/common/partners?MP=7100-2700',
                                 ],
                             ],
                         ],
index 0c63aa0..3316b8f 100644 (file)
@@ -84,6 +84,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
      */
     public function localizeContent()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeContent();
         $this->assertAssertionDataSet('localizeContent');
 
index b831881..d71b701 100644 (file)
@@ -87,6 +87,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
      */
     public function localizeContent()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeContent();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $this->assertAssertionDataSet('localizeContent');
index 5f4c5b6..2abcb78 100644 (file)
@@ -87,6 +87,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
      */
     public function localizeContent()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeContent();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeContent');
index efe5ff4..347f53a 100644 (file)
@@ -256,6 +256,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro
      */
     public function localizeElementOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeElementOfRelation();
         $this->assertAssertionDataSet('localizeElementOfRelation');
 
index 846a889..61ede34 100644 (file)
@@ -4,6 +4,8 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,1,1,0,0,0,"[Translate to Dansk:] Relations",,,
+,92,-1,256,0,1,-1,0,91,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","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,"Regular Element #1","1,2"
index 6fe84fa..9c4e526 100644 (file)
@@ -280,6 +280,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro
      */
     public function localizeElementOfRelation()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord('pages', $translatedPageResult['pages'][self::VALUE_PageId]);
         parent::localizeElementOfRelation();
         $this->actionService->publishRecord(self::TABLE_Element, $this->recordIds['localizedElementId']);
         $this->assertAssertionDataSet('localizeElementOfRelation');
index 98a6d88..eb15924 100644 (file)
@@ -4,6 +4,7 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","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,"Regular Element #1","1,2"
index b2acbb1..f5382ee 100644 (file)
@@ -270,6 +270,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro
      */
     public function localizeElementOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeElementOfRelation();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeElementOfRelation');
index 98a6d88..eb15924 100644 (file)
@@ -4,6 +4,7 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","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,"Regular Element #1","1,2"
index e581d3e..2d150db 100644 (file)
@@ -123,6 +123,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeParentContentWithAllChildren();
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
 
@@ -313,6 +315,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
 
index 86eea86..9a0419d 100644 (file)
@@ -126,6 +126,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeParentContentWithAllChildren();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
@@ -344,6 +347,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
index f3701cb..aad5010 100644 (file)
@@ -125,6 +125,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeParentContentWithAllChildren();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
@@ -326,6 +328,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
index 32656a8..1e61ad6 100644 (file)
@@ -123,6 +123,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeParentContentWithAllChildren();
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
 
@@ -313,6 +315,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
 
@@ -333,6 +337,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
         $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
 
index 39b394f..2053e08 100644 (file)
@@ -130,6 +130,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeParentContentWithAllChildren();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
@@ -349,6 +352,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
index 5a7be5b..52fbe93 100644 (file)
@@ -129,6 +129,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function localizeParentContentWithAllChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeParentContentWithAllChildren();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeParentContentWAllChildren');
@@ -331,6 +333,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
      */
     public function createAndLocalizeParentContentWithHotelAndOfferChildren()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
index 8f98a99..4cfe372 100644 (file)
@@ -283,6 +283,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man
      */
     public function localizeCategoryOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeCategoryOfRelation();
         $this->assertAssertionDataSet('localizeCategoryOfRelation');
 
index 797e10f..0eae14d 100644 (file)
@@ -326,6 +326,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man
      */
     public function localizeCategoryOfRelation()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeCategoryOfRelation();
         $this->actionService->publishRecord(self::TABLE_Category, $this->recordIds['localizedCategoryId']);
         $this->assertAssertionDataSet('localizeCategoryOfRelation');
index 008f51a..253fc4f 100644 (file)
@@ -300,6 +300,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man
      */
     public function localizeCategoryOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeCategoryOfRelation();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeCategoryOfRelation');
index 6e9dc97..54ffae9 100644 (file)
@@ -136,13 +136,15 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     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, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->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'));
@@ -154,13 +156,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     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, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
@@ -172,6 +177,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContent()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeContent();
         $this->assertAssertionDataSet('localizeContent');
 
@@ -186,6 +193,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContentFromNonDefaultLanguage()
     {
+        // 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::localizeContentFromNonDefaultLanguage();
 
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
@@ -455,7 +465,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('createContentAndCopyDraftPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
@@ -488,7 +498,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('createPageAndCopyDraftParentPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
@@ -521,7 +531,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
@@ -554,7 +564,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('deleteContentAndCopyDraftPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
@@ -590,7 +600,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
@@ -623,7 +633,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         $this->assertAssertionDataSet('moveContentAndCopyDraftPage');
 
         $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
-        $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']);
+        $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
index d8b0d55..675919e 100644 (file)
@@ -154,14 +154,17 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function copyContentToLanguage()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::copyContentToLanguage();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $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'));
@@ -173,14 +176,17 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function copyContentToLanguageFromNonDefaultLanguage()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::copyContentToLanguageFromNonDefaultLanguage();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $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 "dk" 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'));
@@ -192,6 +198,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContent()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeContent();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $this->assertAssertionDataSet('localizeContent');
@@ -207,6 +216,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContentFromNonDefaultLanguage()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
+        $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
         parent::localizeContentFromNonDefaultLanguage();
         $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
index 836a701..cb322b7 100644 (file)
@@ -143,14 +143,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function copyContentToLanguage()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::copyContentToLanguage();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $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'));
@@ -162,14 +164,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function copyContentToLanguageFromNonDefaultLanguage()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
         parent::copyContentToLanguageFromNonDefaultLanguage();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $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'));
@@ -181,6 +185,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContent()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeContent();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeContent');
@@ -196,6 +202,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
      */
     public function localizeContentFromNonDefaultLanguage()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
         parent::localizeContentFromNonDefaultLanguage();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
index ef0a7ab..c8e6c71 100644 (file)
@@ -256,6 +256,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel
      */
     public function localizeElementOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeElementOfRelation();
         $this->assertAssertionDataSet('localizeElementOfRelation');
 
index 8f4e06d..0d3770a 100644 (file)
@@ -4,6 +4,8 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,1,1,0,0,0,"[Translate to Dansk:] Relations",,,
+,92,-1,256,0,1,-1,0,91,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select"
 ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"
index 4fecac8..ddb0d6a 100644 (file)
@@ -280,6 +280,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel
      */
     public function localizeElementOfRelation()
     {
+        // Create and publish translated page first
+        $translatedPageResult = $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
+        $this->actionService->publishRecord('pages', $translatedPageResult['pages'][self::VALUE_PageId]);
         parent::localizeElementOfRelation();
         $this->actionService->publishRecord(self::TABLE_Element, $this->recordIds['localizedElementId']);
         $this->assertAssertionDataSet('localizeElementOfRelation');
index 113a38d..098cb54 100644 (file)
@@ -4,6 +4,7 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select"
 ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"
index 77d373a..ca8cada 100644 (file)
@@ -270,6 +270,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel
      */
     public function localizeElementOfRelation()
     {
+        // Create translated page first
+        $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
         parent::localizeElementOfRelation();
         $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
         $this->assertAssertionDataSet('localizeElementOfRelation');
index 113a38d..098cb54 100644 (file)
@@ -4,6 +4,7 @@
 ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,
 ,89,88,256,0,0,0,0,0,0,"Relations",,,
 ,90,88,512,0,0,0,0,0,0,"Target",,,
+,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,,
 "tt_content",,,,,,,,,,,,,
 ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select"
 ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"