[!!!][TASK] Remove Extbase mode for non-consistentTranslationOverlayHandling 55/59255/7
authorBenni Mack <benni@typo3.org>
Fri, 21 Dec 2018 11:54:10 +0000 (12:54 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 22 Dec 2018 15:18:13 +0000 (16:18 +0100)
The feature flag and all its logic for not using the
consistentTranslationOverlayHandling in Extbase has been removed.

Along with that, QuerySettings interface has two methods less to implement:
- setLanguageMode()
- getLanguageMode()

The methods are kept within the implementation in Typo3QuerySettings without
any actions for now.

Resolves: #87264
Releases: master
Change-Id: Id4f46c8ff61ec86697d8b9dcbe6cd489b2782c0d
Reviewed-on: https://review.typo3.org/59255
Reviewed-by: Alexander Schnitzler <typo3@alexanderschnitzler.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
17 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/extbase/Classes/Domain/Model/FileReference.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/Generic/QuerySettingsInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
typo3/sysext/extbase/Classes/Persistence/Generic/Typo3QuerySettings.php
typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ControllerArgumentsMappingTest.php
typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataLegacyTest.php [deleted file]
typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php
typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedContentLegacyTest.php [deleted file]
typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedContentTest.php
typo3/sysext/extbase/Tests/Functional/Persistence/TranslationLegacyTest.php [deleted file]
typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
typo3/sysext/extbase/ext_typoscript_setup.typoscript

index 3ca0cad..1a4797b 100644 (file)
@@ -885,6 +885,7 @@ The following hooks have been removed:
 
 The following feature is now always enabled:
 
+* Extbase's :php:`consistentTranslationOverlayHandling` - Translations in Extbase are now always consistent
 * :php:`simplifiedControllerActionDispatching` - Backend controller actions do not receive a prepared response object anymore
 
 
index 5248161..43f987a 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Extbase\Domain\Model;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
-
 /**
  * A file reference object (File Abstraction Layer)
  *
@@ -32,19 +30,6 @@ class FileReference extends \TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder
     protected $uidLocal;
 
     /**
-     * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     */
-    protected $configurationManager;
-
-    /**
-     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-     */
-    public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
-    {
-        $this->configurationManager = $configurationManager;
-    }
-
-    /**
      * @param \TYPO3\CMS\Core\Resource\ResourceInterface $originalResource
      */
     public function setOriginalResource(\TYPO3\CMS\Core\Resource\ResourceInterface $originalResource)
@@ -59,10 +44,7 @@ class FileReference extends \TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder
     public function getOriginalResource()
     {
         if ($this->originalResource === null) {
-            $uid = $this->getUid();
-            if ($this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling')) {
-                $uid = $this->_localizedUid;
-            }
+            $uid = $this->_localizedUid;
             $this->originalResource = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileReferenceObject($uid);
         }
 
index 5599fa0..792cd8b 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Mapper;
  */
 
 use TYPO3\CMS\Core\Database\Query\QueryHelper;
-use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface;
 use TYPO3\CMS\Extbase\Object\Exception\CannotReconstituteObjectException;
 use TYPO3\CMS\Extbase\Persistence;
@@ -72,11 +71,6 @@ class DataMapper
     protected $signalSlotDispatcher;
 
     /**
-     * @var ConfigurationManagerInterface
-     */
-    protected $configurationManager;
-
-    /**
      * @var ?QueryInterface
      */
     protected $query;
@@ -147,14 +141,6 @@ class DataMapper
     }
 
     /**
-     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-     */
-    public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
-    {
-        $this->configurationManager = $configurationManager;
-    }
-
-    /**
      * Maps the given rows on objects
      *
      * @param string $className The name of the class
@@ -453,19 +439,17 @@ class DataMapper
         $query->getQuerySettings()->setRespectStoragePage(false);
         $query->getQuerySettings()->setRespectSysLanguage(false);
 
-        if ($this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling')) {
-            //we always want to overlay relations as most of the time they are stored in db using default lang uids
-            $query->getQuerySettings()->setLanguageOverlayMode(true);
-            if ($this->query) {
-                $query->getQuerySettings()->setLanguageUid($this->query->getQuerySettings()->getLanguageUid());
-
-                if ($dataMap->getLanguageIdColumnName() !== null && !$this->query->getQuerySettings()->getRespectSysLanguage()) {
-                    //pass language of parent record to child objects, so they can be overlaid correctly in case
-                    //e.g. findByUid is used.
-                    //the languageUid is used for getRecordOverlay later on, despite RespectSysLanguage being false
-                    $languageUid = (int)$parentObject->_getProperty('_languageUid');
-                    $query->getQuerySettings()->setLanguageUid($languageUid);
-                }
+        // we always want to overlay relations as most of the time they are stored in db using default lang uids
+        $query->getQuerySettings()->setLanguageOverlayMode(true);
+        if ($this->query) {
+            $query->getQuerySettings()->setLanguageUid($this->query->getQuerySettings()->getLanguageUid());
+
+            if ($dataMap->getLanguageIdColumnName() !== null && !$this->query->getQuerySettings()->getRespectSysLanguage()) {
+                //pass language of parent record to child objects, so they can be overlaid correctly in case
+                //e.g. findByUid is used.
+                //the languageUid is used for getRecordOverlay later on, despite RespectSysLanguage being false
+                $languageUid = (int)$parentObject->_getProperty('_languageUid');
+                $query->getQuerySettings()->setLanguageUid($languageUid);
             }
         }
 
index 6c652c7..bc9fafc 100644 (file)
@@ -77,21 +77,6 @@ interface QuerySettingsInterface
     public function getLanguageOverlayMode();
 
     /**
-     * Language Mode is NOT used when consistentTranslationOverlayHandling is enabled
-     *
-     * @param string $languageMode NULL, "content_fallback", "strict" or "ignore"
-     * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
-     */
-    public function setLanguageMode($languageMode);
-
-    /**
-     * Language Mode is NOT used when consistentTranslationOverlayHandling is enabled
-     *
-     * @return string NULL, "content_fallback", "strict" or "ignore"
-     */
-    public function getLanguageMode();
-
-    /**
      * @param int $languageUid
      * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
      */
index ab50545..c06838a 100644 (file)
@@ -31,7 +31,6 @@ use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
 use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
 use TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 use TYPO3\CMS\Extbase\Persistence\Generic\Query;
-use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
 use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException;
 use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException;
 use TYPO3\CMS\Extbase\Persistence\QueryInterface;
@@ -376,10 +375,8 @@ class Typo3DbBackend implements BackendInterface, SingletonInterface
             }
         }
 
-        if ($this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling') && !empty($rows)) {
+        if (!empty($rows)) {
             $rows = $this->overlayLanguageAndWorkspace($query->getSource(), $rows, $query);
-        } else {
-            $rows = $this->doLanguageAndWorkspaceOverlay($query->getSource(), $rows, $query->getQuerySettings());
         }
 
         return $rows;
@@ -534,115 +531,6 @@ class Typo3DbBackend implements BackendInterface, SingletonInterface
      * Performs workspace and language overlay on the given row array. The language and workspace id is automatically
      * detected (depending on FE or BE context). You can also explicitly set the language/workspace id.
      *
-     * This method performs overlay in a legacy way (when consistentTranslationOverlayHandling flag is disabled)
-     *
-     * @param Qom\SourceInterface $source The source (selector od join)
-     * @param array $rows
-     * @param QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
-     * @param int|null $workspaceUid
-     * @return array
-     */
-    protected function doLanguageAndWorkspaceOverlay(Qom\SourceInterface $source, array $rows, QuerySettingsInterface $querySettings, $workspaceUid = null)
-    {
-        if ($source instanceof Qom\SelectorInterface) {
-            $tableName = $source->getSelectorName();
-        } elseif ($source instanceof Qom\JoinInterface) {
-            $tableName = $source->getRight()->getSelectorName();
-        } else {
-            // No proper source, so we do not have a table name here
-            // we cannot do an overlay and return the original rows instead.
-            return $rows;
-        }
-
-        $context = $this->objectManager->get(Context::class);
-        if ($workspaceUid === null) {
-            $workspaceUid = $context->getPropertyFromAspect('workspace', 'id');
-        } else {
-            // A custom query is needed, so a custom context is cloned
-            $workspaceUid = (int)$workspaceUid;
-            $context = clone $context;
-            $context->setAspect('workspace', $this->objectManager->get(WorkspaceAspect::class, $workspaceUid));
-        }
-        $pageRepository = $this->objectManager->get(PageRepository::class, $context);
-
-        // Fetches the move-placeholder in case it is supported
-        // by the table and if there's only one row in the result set
-        // (applying this to all rows does not work, since the sorting
-        // order would be destroyed and possible limits not met anymore)
-        if (!empty($workspaceUid)
-            && BackendUtility::isTableWorkspaceEnabled($tableName)
-            && count($rows) === 1
-        ) {
-            $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
-            $queryBuilder->getRestrictions()->removeAll();
-            $movePlaceholder = $queryBuilder
-                ->select($tableName . '.*')
-                ->from($tableName)
-                ->where(
-                    $queryBuilder->expr()->eq('t3ver_state', $queryBuilder->createNamedParameter(3, \PDO::PARAM_INT)),
-                    $queryBuilder->expr()->eq('t3ver_wsid', $queryBuilder->createNamedParameter($workspaceUid, \PDO::PARAM_INT)),
-                    $queryBuilder->expr()->eq('t3ver_move_id', $queryBuilder->createNamedParameter($rows[0]['uid'], \PDO::PARAM_INT))
-                )
-                ->setMaxResults(1)
-                ->execute()
-                ->fetch();
-            if (!empty($movePlaceholder)) {
-                $rows = [$movePlaceholder];
-            }
-        }
-
-        $overlaidRows = [];
-        foreach ($rows as $row) {
-            // If current row is a translation select its parent
-            if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
-                && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
-                && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
-                && isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']])
-                && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
-            ) {
-                $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
-                $queryBuilder->getRestrictions()->removeAll();
-                $row = $queryBuilder
-                    ->select($tableName . '.*')
-                    ->from($tableName)
-                    ->where(
-                        $queryBuilder->expr()->eq(
-                            $tableName . '.uid',
-                            $queryBuilder->createNamedParameter(
-                                $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']],
-                                \PDO::PARAM_INT
-                            )
-                        ),
-                        $queryBuilder->expr()->eq(
-                            $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'],
-                            $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
-                        )
-                    )
-                    ->setMaxResults(1)
-                    ->execute()
-                    ->fetch();
-            }
-            $pageRepository->versionOL($tableName, $row, true);
-            if ($tableName === 'pages') {
-                $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
-            } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
-                && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
-                && in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], [-1, 0])
-            ) {
-                $overlayMode = $querySettings->getLanguageMode() === 'strict' ? 'hideNonTranslated' : '';
-                $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getLanguageUid(), $overlayMode);
-            }
-            if (is_array($row)) {
-                $overlaidRows[] = $row;
-            }
-        }
-        return $overlaidRows;
-    }
-
-    /**
-     * Performs workspace and language overlay on the given row array. The language and workspace id is automatically
-     * detected (depending on FE or BE context). You can also explicitly set the language/workspace id.
-     *
      * @param Qom\SourceInterface $source The source (selector or join)
      * @param array $rows
      * @param QueryInterface $query
index e19cf8c..ce1d8eb 100644 (file)
@@ -20,7 +20,6 @@ use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression;
 use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;
@@ -323,8 +322,8 @@ class Typo3DbQueryParser
     {
         $index = 0;
         foreach ($this->tableAliasMap as $tableAlias => $tableName) {
-            if ($index === 0 || !$this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling')) {
-                // With the new behaviour enabled, we only add the pid and language check for the first table (aggregate root).
+            if ($index === 0) {
+                // We only add the pid and language check for the first table (aggregate root).
                 // We know the first table is always the main table for the current query run.
                 $additionalWhereClauses = $this->getAdditionalWhereClause($query->getQuerySettings(), $tableName, $tableAlias);
             } else {
@@ -560,9 +559,7 @@ class Typo3DbQueryParser
      */
     protected function createTypedNamedParameter($value, int $forceType = null): string
     {
-        $consistentHandlingEnabled = $this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling');
-        if ($consistentHandlingEnabled
-            && $value instanceof AbstractDomainObject
+        if ($value instanceof AbstractDomainObject
             && $value->_hasProperty('_localizedUid')
             && $value->_getProperty('_localizedUid') > 0
         ) {
@@ -692,12 +689,7 @@ class Typo3DbQueryParser
     {
         $whereClause = [];
         if ($querySettings->getRespectSysLanguage()) {
-            if ($this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling')) {
-                $systemLanguageStatement = $this->getLanguageStatement($tableName, $tableAlias, $querySettings);
-            } else {
-                $systemLanguageStatement = $this->getSysLanguageStatement($tableName, $tableAlias, $querySettings);
-            }
-
+            $systemLanguageStatement = $this->getLanguageStatement($tableName, $tableAlias, $querySettings);
             if (!empty($systemLanguageStatement)) {
                 $whereClause[] = $systemLanguageStatement;
             }
@@ -791,88 +783,6 @@ class Typo3DbQueryParser
     }
 
     /**
-     * Builds the language field statement in a legacy way (when consistentTranslationOverlayHandling flag is disabled)
-     *
-     * @param string $tableName The database table name
-     * @param string $tableAlias The table alias used in the query.
-     * @param QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
-     * @return string
-     */
-    protected function getSysLanguageStatement($tableName, $tableAlias, $querySettings)
-    {
-        if (is_array($GLOBALS['TCA'][$tableName]['ctrl'])) {
-            if (!empty($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])) {
-                // Select all entries for the current language
-                // If any language is set -> get those entries which are not translated yet
-                // They will be removed by \TYPO3\CMS\Frontend\Page\PageRepository::getRecordOverlay if not matching overlay mode
-                $languageField = $GLOBALS['TCA'][$tableName]['ctrl']['languageField'];
-
-                if (isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
-                    && $querySettings->getLanguageUid() > 0
-                ) {
-                    $mode = $querySettings->getLanguageMode();
-
-                    if ($mode === 'strict') {
-                        $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
-                        $queryBuilderForSubselect->getRestrictions()->removeAll()->add(new DeletedRestriction());
-                        $queryBuilderForSubselect
-                            ->select($tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
-                            ->from($tableName)
-                            ->where(
-                                $queryBuilderForSubselect->expr()->andX(
-                                    $queryBuilderForSubselect->expr()->gt($tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'], 0),
-                                    $queryBuilderForSubselect->expr()->eq($tableName . '.' . $languageField, (int)$querySettings->getLanguageUid())
-                                )
-                            );
-                        return $this->queryBuilder->expr()->orX(
-                            $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, -1),
-                            $this->queryBuilder->expr()->andX(
-                                $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, (int)$querySettings->getLanguageUid()),
-                                $this->queryBuilder->expr()->eq($tableAlias . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'], 0)
-                            ),
-                            $this->queryBuilder->expr()->andX(
-                                $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, 0),
-                                $this->queryBuilder->expr()->in(
-                                    $tableAlias . '.uid',
-                                    $queryBuilderForSubselect->getSQL()
-
-                                )
-                            )
-                        );
-                    }
-                    $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
-                    $queryBuilderForSubselect->getRestrictions()->removeAll()->add(new DeletedRestriction());
-                    $queryBuilderForSubselect
-                            ->select($tableAlias . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
-                            ->from($tableName)
-                            ->where(
-                                $queryBuilderForSubselect->expr()->andX(
-                                    $queryBuilderForSubselect->expr()->gt($tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'], 0),
-                                    $queryBuilderForSubselect->expr()->eq($tableName . '.' . $languageField, (int)$querySettings->getLanguageUid())
-                                )
-                            );
-                    return $this->queryBuilder->expr()->orX(
-                            $this->queryBuilder->expr()->in($tableAlias . '.' . $languageField, [(int)$querySettings->getLanguageUid(), -1]),
-                            $this->queryBuilder->expr()->andX(
-                                $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, 0),
-                                $this->queryBuilder->expr()->notIn(
-                                    $tableAlias . '.uid',
-                                    $queryBuilderForSubselect->getSQL()
-
-                                )
-                            )
-                        );
-                }
-                return $this->queryBuilder->expr()->in(
-                        $tableAlias . '.' . $languageField,
-                        [(int)$querySettings->getLanguageUid(), -1]
-                    );
-            }
-        }
-        return '';
-    }
-
-    /**
      * Builds the language field statement
      *
      * @param string $tableName The database table name
index 314f921..4252fc9 100644 (file)
@@ -79,15 +79,6 @@ class Typo3QuerySettings implements QuerySettingsInterface
     protected $languageOverlayMode = true;
 
     /**
-     * Language Mode is NOT used when consistentTranslationOverlayHandling is enabled
-     *
-     * Representing sys_language_mode only valid for current context
-     *
-     * @var string
-     */
-    protected $languageMode;
-
-    /**
      * Representing sys_language_uid only valid for current context
      *
      * @var int
@@ -128,7 +119,6 @@ class Typo3QuerySettings implements QuerySettingsInterface
         if ($this->environmentService->isEnvironmentInFrontendMode()) {
             $overlayMode = $languageAspect->getLegacyOverlayType() === 'hideNonTranslated' ? 'hideNonTranslated' : (bool)$languageAspect->getLegacyOverlayType();
             $this->setLanguageOverlayMode($overlayMode);
-            $this->setLanguageMode($languageAspect->getLegacyLanguageMode() ?: null);
         } elseif ((int)GeneralUtility::_GP('L')) {
             // Set language from 'L' parameter
             $this->setLanguageUid((int)GeneralUtility::_GP('L'));
@@ -216,25 +206,24 @@ class Typo3QuerySettings implements QuerySettingsInterface
     }
 
     /**
-     * Language Mode is NOT used when consistentTranslationOverlayHandling is enabled
+     * Language Mode is NOT used anymore, so just avoid using it. Will be deprecated in the future.
      *
-     * @param string $languageMode NULL, "content_fallback", "strict" or "ignore"
+     * @param string $languageMode
      * @return QuerySettingsInterface instance of $this to allow method chaining
      */
     public function setLanguageMode($languageMode = '')
     {
-        $this->languageMode = $languageMode;
         return $this;
     }
 
     /**
-     * Language Mode is NOT used when consistentTranslationOverlayHandling is enabled
+     * Language Mode is NOT used anymore, so just avoid using it. Will be deprecated in the future.
      *
      * @return string NULL, "content_fallback", "strict" or "ignore"
      */
     public function getLanguageMode()
     {
-        return $this->languageMode;
+        return null;
     }
 
     /**
index 0ef0098..7a39272 100644 (file)
@@ -61,7 +61,6 @@ class ControllerArgumentsMappingTest extends \TYPO3\TestingFramework\Core\Functi
 
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
         $configuration = [
-            'features' => ['consistentTranslationOverlayHandling' => 1],
             'persistence' => [
                 'storagePid' => 20,
                 'classes' => [
diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataLegacyTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataLegacyTest.php
deleted file mode 100644 (file)
index 58855fb..0000000
+++ /dev/null
@@ -1,1160 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Extbase\Tests\Functional\Persistence;
-
-/*
- * 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 PHPUnit\Framework\MockObject\MockObject;
-use TYPO3\CMS\Core\Context\Context;
-use TYPO3\CMS\Core\Context\LanguageAspect;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
-use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
-use TYPO3\CMS\Extbase\Persistence\QueryInterface;
-use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
-use TYPO3\CMS\Extbase\Service\EnvironmentService;
-use TYPO3\CMS\Frontend\Page\PageRepository;
-
-/**
- * This test proves there is no regression between how Extbase query localized records in v8 and v9
- * The feature flag `consistentTranslationOverlayHandling` is off.
- */
-class QueryLocalizedDataLegacyTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
-{
-    /**
-     * @var array
-     */
-    protected $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example'];
-
-    /**
-     * @var array
-     */
-    protected $coreExtensionsToLoad = ['extbase', 'fluid'];
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface The object manager
-     */
-    protected $objectManager;
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Persistence\Repository
-     */
-    protected $postRepository;
-
-    /**
-     * @var PersistenceManager;
-     */
-    protected $persistenceManager;
-
-    /**
-     * Sets up this test suite.
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-
-        $this->importCSVDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translatedBlogExampleData.csv');
-        $this->setUpBasicFrontendEnvironment();
-
-        $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $configuration = [
-            'features' => ['consistentTranslationOverlayHandling' => 0],
-            'persistence' => [
-                'storagePid' => 20,
-                'classes' => [
-                    'TYPO3\CMS\Extbase\Domain\Model\Category' => [
-                        'mapping' => ['tableName' => 'sys_category']
-                    ]
-                ]
-            ]
-        ];
-        $configurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
-        $configurationManager->setConfiguration($configuration);
-        $this->postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
-        $this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
-    }
-
-    /**
-     * Minimal frontend environment to satisfy Extbase Typo3DbBackend
-     */
-    protected function setUpBasicFrontendEnvironment()
-    {
-        /** @var MockObject|EnvironmentService $environmentServiceMock */
-        $environmentServiceMock = $this->createMock(EnvironmentService::class);
-        $environmentServiceMock
-            ->expects($this->atLeast(1))
-            ->method('isEnvironmentInFrontendMode')
-            ->willReturn(true);
-        GeneralUtility::setSingletonInstance(EnvironmentService::class, $environmentServiceMock);
-
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_ON, []));
-
-        $pageRepositoryFixture = new PageRepository();
-        $frontendControllerMock = $this->createMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class);
-        $frontendControllerMock->sys_page = $pageRepositoryFixture;
-        $GLOBALS['TSFE'] = $frontendControllerMock;
-    }
-
-    /**
-     * Test in default language
-     *
-     * With overlays enabled it doesn't make a difference whether you call findByUid with translated record uid or
-     * default language record uid.
-     *
-     * @test
-     */
-    public function findByUidOverlayModeOnDefaultLanguage()
-    {
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_ON));
-
-        $post2 = $this->postRepository->findByUid(2);
-
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $post2translated = $this->postRepository->findByUid(11);
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2translated->getTitle(),
-            $post2translated->getUid(),
-            $post2translated->_getProperty('_localizedUid'),
-            $post2translated->getBlog()->getTitle(),
-            $post2translated->getBlog()->getUid(),
-            $post2translated->getBlog()->_getProperty('_localizedUid'),
-            $post2translated->getAuthor()->getFirstname(),
-            $post2translated->getAuthor()->getUid(),
-            $post2translated->getAuthor()->_getProperty('_localizedUid')
-        ]);
-    }
-
-    /**
-     * Test in default language, overlays disabled
-     *
-     * @test
-     */
-    public function findByUidNoOverlaysDefaultLanguage()
-    {
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_OFF));
-
-        $post2 = $this->postRepository->findByUid(2);
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $post2translated = $this->postRepository->findByUid(11);
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2translated->getTitle(),
-            $post2translated->getUid(),
-            $post2translated->_getProperty('_localizedUid'),
-            $post2translated->getBlog()->getTitle(),
-            $post2translated->getBlog()->getUid(),
-            $post2translated->getBlog()->_getProperty('_localizedUid'),
-            $post2translated->getAuthor()->getFirstname(),
-            $post2translated->getAuthor()->getUid(),
-            $post2translated->getAuthor()->_getProperty('_localizedUid')
-        ]);
-    }
-
-    /**
-     * Test in language uid:1, overlays enabled
-     *
-     * @test
-     */
-    public function findByUidOverlayModeOnLanguage()
-    {
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_ON));
-
-        $post2 = $this->postRepository->findByUid(2);
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-        $post2translated = $this->postRepository->findByUid(11);
-
-        foreach ([$post2, $post2translated] as $post) {
-            $this->assertEquals(['Post 2 - DK', 2, 11, 'Blog 1 DK', 1, 2, 'Translated John', 1, 2], [
-                $post->getTitle(),
-                $post->getUid(),
-                $post->_getProperty('_localizedUid'),
-                $post->getBlog()->getTitle(),
-                $post->getBlog()->getUid(),
-                $post->getBlog()->_getProperty('_localizedUid'),
-                $post->getAuthor()->getFirstname(),
-                $post->getAuthor()->getUid(),
-                $post->getAuthor()->_getProperty('_localizedUid')
-            ]);
-        }
-    }
-
-    /**
-     * Test in language uid:1, overlays disabled
-     *
-     * @test
-     */
-    public function findByUidNoOverlaysLanguage()
-    {
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_OFF));
-
-        $post2 = $this->postRepository->findByUid(2);
-        $this->assertEquals(['Post 2 - DK', 2, 11, 'Blog 1 DK', 1, 2, 'Translated John', 1, 2], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $post2translated = $this->postRepository->findByUid(11);
-        $this->assertEquals(['Post 2 - DK', 2, 11, 'Blog 1 DK', 1, 2, 'Translated John', 1, 2], [
-            $post2translated->getTitle(),
-            $post2translated->getUid(),
-            $post2translated->_getProperty('_localizedUid'),
-            $post2translated->getBlog()->getTitle(),
-            $post2translated->getBlog()->getUid(),
-            $post2translated->getBlog()->_getProperty('_localizedUid'),
-            $post2translated->getAuthor()->getFirstname(),
-            $post2translated->getAuthor()->getUid(),
-            $post2translated->getAuthor()->_getProperty('_localizedUid')
-        ]);
-    }
-
-    /**
-     * This tests shows what query by uid returns depending on the language,
-     * and used uid (default language record or translated record uid).
-     * All with overlay mode enabled.
-     *
-     * The post with uid 2 is translated to language 1, and there has uid 11.
-     *
-     * @test
-     */
-    public function customFindByUidOverlayEnabled()
-    {
-        // we're in default lang and fetching by uid of the record in default language
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(0);
-        $querySettings->setLanguageOverlayMode(true);
-        $query->matching($query->equals('uid', 2));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(0);
-        $querySettings->setLanguageOverlayMode(true);
-        $query->matching($query->equals('uid', 11));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertNull($post2);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageOverlayMode(true);
-        $query->matching($query->equals('uid', 2));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertEquals(['Post 2 - DK', 2, 11, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageOverlayMode(true);
-        $query->matching($query->equals('uid', 11));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertNull($post2);
-    }
-
-    /**
-     * This tests shows what query by uid returns depending on the language,
-     * and used uid (default language record or translated record uid).
-     * All with overlay mode disabled.
-     *
-     * The post with uid 2 is translated to language 1, and there has uid 11.
-     *
-     * @test
-     */
-    public function customFindByUidOverlayDisabled()
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(0);
-        $querySettings->setLanguageOverlayMode(false);
-        $query->matching($query->equals('uid', 2));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertEquals(['Post 2', 2, 2, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(0);
-        $querySettings->setLanguageOverlayMode(false);
-        $query->matching($query->equals('uid', 11));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertNull($post2);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageOverlayMode(false);
-        $query->matching($query->equals('uid', 2));
-        $post2 = $query->execute()->getFirst();
-
-        //the john is not translated but it should, see next query in this test
-        $this->assertEquals(['Post 2 - DK', 2, 11, 'Blog 1', 1, 1, 'John', 1, 1], [
-            $post2->getTitle(),
-            $post2->getUid(),
-            $post2->_getProperty('_localizedUid'),
-            $post2->getBlog()->getTitle(),
-            $post2->getBlog()->getUid(),
-            $post2->getBlog()->_getProperty('_localizedUid'),
-            $post2->getAuthor()->getFirstname(),
-            $post2->getAuthor()->getUid(),
-            $post2->getAuthor()->_getProperty('_localizedUid')
-        ]);
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageOverlayMode(false);
-        $query->matching($query->equals('uid', 11));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertNull($post2);
-
-        //We're setting global context here to show that the result is different then one above.
-        //this means that language which is set in global context influences overlays of relations
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_ON));
-
-        //this is needed because of https://forge.typo3.org/issues/59992
-        $this->persistenceManager->clearState();
-
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageOverlayMode(false);
-        $query->matching($query->equals('uid', 11));
-        $post2 = $query->execute()->getFirst();
-
-        $this->assertNull($post2);
-    }
-
-    public function queryFirst5PostsDataProvider()
-    {
-        //put it to variable to make cases with the same expected values explicit
-        $lang0Expected = [
-            [
-                'title' => 'Post 4',
-                'uid' => 4,
-                '_localizedUid' => 4,
-                'content' => 'A - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-                'tags' => [],
-            ],
-            [
-                'title' => 'Post 2',
-                'uid' => 2,
-                '_localizedUid' => 2,
-                'content' => 'B - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-                'tags.0.name' => 'Tag2',
-                'tags.0.uid' => 2,
-                'tags.0._localizedUid' => 2,
-                'tags.1.name' => 'Tag3',
-                'tags.1.uid' => 3,
-                'tags.1._localizedUid' => 3,
-                'tags.2.name' => 'Tag4',
-                'tags.2.uid' => 4,
-                'tags.2._localizedUid' => 4,
-            ],
-            [
-                'title' => 'Post 7',
-                'uid' => 7,
-                '_localizedUid' => 7,
-                'content' => 'C - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-                'tags' => [],
-            ],
-            [
-                'title' => 'Post 6',
-                'uid' => 6,
-                '_localizedUid' => 6,
-                'content' => 'F - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-                'tags' => [],
-            ],
-            [
-                'title' => 'Post 1 - not translated',
-                'uid' => 1,
-                '_localizedUid' => 1,
-                'content' => 'G - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'Never translate me henry',
-                'secondAuthor.uid' => 3,
-                'secondAuthor._localizedUid' => 3,
-                'tags.0.name' => 'Tag1',
-                'tags.0.uid' => 1,
-                'tags.0._localizedUid' => 1,
-                'tags.1.name' => 'Tag2',
-                'tags.1.uid' => 2,
-                'tags.1._localizedUid' => 2,
-                'tags.2.name' => 'Tag3',
-                'tags.2.uid' => 3,
-                'tags.2._localizedUid' => 3,
-            ],
-        ];
-        return [
-            [
-                'language' => 0,
-                'overlay' => true,
-                'expected' => $lang0Expected
-            ],
-            [
-                'language' => 0,
-                'overlay' => false,
-                'expected' => $lang0Expected
-            ],
-            [
-                'language' => 1,
-                'overlay' => true,
-                'expected' => [
-                    [
-                        'title' => 'Post 4 - DK',
-                        'uid' => 4,
-                        '_localizedUid' => 12,
-                        'content' => 'U - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 2 - DK',
-                        'uid' => 2,
-                        '_localizedUid' => 11,
-                        'content' => 'C - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags.0.name' => 'Tag2',
-                        'tags.0.uid' => 2,
-                        'tags.0._localizedUid' => 2,
-                        'tags.1.name' => 'Tag3',
-                        'tags.1.uid' => 3,
-                        'tags.1._localizedUid' => 3,
-                        'tags.2.name' => 'Tag4',
-                        'tags.2.uid' => 4,
-                        'tags.2._localizedUid' => 4,
-                    ],
-                    [
-                        'title' => 'Post DK only',
-                        'uid' => 15,
-                        '_localizedUid' => 15,
-                        'content' => 'B - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 7 - DK',
-                        'uid' => 7,
-                        '_localizedUid' => 14,
-                        'content' => 'S - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 5 - DK',
-                        'uid' => 5,
-                        '_localizedUid' => 13,
-                        'content' => 'A - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                ],
-            ],
-            [
-                'language' => 1,
-                'overlay' => 'hideNonTranslated',
-                'expected' => [
-                    [
-                        'title' => 'Post 4 - DK',
-                        'uid' => 4,
-                        '_localizedUid' => 12,
-                        'content' => 'U - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 2 - DK',
-                        'uid' => 2,
-                        '_localizedUid' => 11,
-                        'content' => 'C - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags.0.name' => 'Tag2',
-                        'tags.0.uid' => 2,
-                        'tags.0._localizedUid' => 2,
-                        'tags.1.name' => 'Tag3',
-                        'tags.1.uid' => 3,
-                        'tags.1._localizedUid' => 3,
-                        'tags.2.name' => 'Tag4',
-                        'tags.2.uid' => 4,
-                        'tags.2._localizedUid' => 4,
-                    ],
-                    [
-                        'title' => 'Post DK only',
-                        'uid' => 15,
-                        '_localizedUid' => 15,
-                        'content' => 'B - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 7 - DK',
-                        'uid' => 7,
-                        '_localizedUid' => 14,
-                        'content' => 'S - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-
-                    ],
-                    [
-                        'title' => 'Post 5 - DK',
-                        'uid' => 5,
-                        '_localizedUid' => 13,
-                        'content' => 'A - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                ],
-            ],
-            [
-                'language' => 1,
-                'overlay' => false,
-                'expected' => [
-                    [
-                        'title' => 'Post 4 - DK',
-                        'uid' => 4,
-                        '_localizedUid' => 12,
-                        'content' => 'U - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 2 - DK',
-                        'uid' => 2,
-                        '_localizedUid' => 11,
-                        'content' => 'C - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags.0.name' => 'Tag2',
-                        'tags.0.uid' => 2,
-                        'tags.0._localizedUid' => 2,
-                        'tags.1.name' => 'Tag3',
-                        'tags.1.uid' => 3,
-                        'tags.1._localizedUid' => 3,
-                        'tags.2.name' => 'Tag4',
-                        'tags.2.uid' => 4,
-                        'tags.2._localizedUid' => 4,
-                    ],
-                    [
-                        'title' => 'Post DK only',
-                        'uid' => 15,
-                        '_localizedUid' => 15,
-                        'content' => 'B - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 7 - DK',
-                        'uid' => 7,
-                        '_localizedUid' => 14,
-                        'content' => 'S - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                    [
-                        'title' => 'Post 5 - DK',
-                        'uid' => 5,
-                        '_localizedUid' => 13,
-                        'content' => 'A - content',
-                        'blog.title' => 'Blog 1',
-                        'blog.uid' => 1,
-                        'blog._localizedUid' => 1,
-                        'author.firstname' => 'John',
-                        'author.uid' => 1,
-                        'author._localizedUid' => 1,
-                        'secondAuthor.firstname' => 'John',
-                        'secondAuthor.uid' => 1,
-                        'secondAuthor._localizedUid' => 1,
-                        'tags' => [],
-                    ],
-                ],
-            ],
-        ];
-    }
-
-    /**
-     * This test check posts returned by repository, when changing language and languageOverlayMode
-     * It also sets limit, offset to validate there are no "gaps" in pagination
-     * and sorting (on a posts property)
-     *
-     * @test
-     * @dataProvider queryFirst5PostsDataProvider
-     *
-     * @param int $languageUid
-     * @param bool $overlay
-     * @param array $expected
-     */
-    public function queryFirst5Posts($languageUid, $overlay, $expected)
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid($languageUid);
-        $querySettings->setLanguageOverlayMode($overlay);
-
-        $query->setOrderings([
-            'content' => QueryInterface::ORDER_ASCENDING,
-            'uid' => QueryInterface::ORDER_ASCENDING
-        ]);
-        $query->setLimit(5);
-        $query->setOffset(0);
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(5, $posts);
-        $this->assertObjectsProperties($posts, $expected);
-    }
-
-    public function queryPostsByPropertyDataProvider()
-    {
-        $lang0Expected = [
-            [
-                'title' => 'Post 5',
-                'uid' => 5,
-                '_localizedUid' => 5,
-                'content' => 'Z - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-            ],
-            [
-                'title' => 'Post 6',
-                'uid' => 6,
-                '_localizedUid' => 6,
-                'content' => 'F - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-                'tags' => [],
-            ]
-        ];
-        $lang1Expected = [
-            [
-                'title' => 'Post 5 - DK',
-                'uid' => 5,
-                '_localizedUid' => 13,
-                'content' => 'A - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-            ],
-            [
-                'title' => 'Post DK only',
-                'uid' => 15,
-                '_localizedUid' => 15,
-                'content' => 'B - content',
-                'blog.title' => 'Blog 1',
-                'blog.uid' => 1,
-                'blog._localizedUid' => 1,
-                'author.firstname' => 'John',
-                'author.uid' => 1,
-                'author._localizedUid' => 1,
-                'secondAuthor.firstname' => 'John',
-                'secondAuthor.uid' => 1,
-                'secondAuthor._localizedUid' => 1,
-            ],
-
-        ];
-        return [
-            [
-                'language' => 0,
-                'overlay' => true,
-                'expected' => $lang0Expected
-            ],
-            [
-                'language' => 0,
-                'overlay' => 'hideNonTranslated',
-                'expected' => $lang0Expected
-            ],
-                    [
-                'language' => 0,
-                'overlay' => false,
-                'expected' => $lang0Expected
-            ],
-            [
-                'language' => 1,
-                'overlay' => true,
-                'expected' => $lang1Expected
-            ],
-            [
-                'language' => 1,
-                'overlay' => 'hideNonTranslated',
-                'expected' => $lang1Expected,
-            ],
-            [
-                'language' => 1,
-                'overlay' => false,
-                'expected' => $lang1Expected,
-            ],
-        ];
-    }
-
-    /**
-     * This test check posts returned by repository, when filtering by property
-     *
-     * "Post 6" is not translated
-     * "Post 5" is translated as "Post 5 - DK"
-     * "Post DK only" has no translation parent
-     *
-     *
-     *
-     * @test
-     * @dataProvider queryPostsByPropertyDataProvider
-     *
-     * @param int $languageUid
-     * @param bool $overlay
-     * @param array $expected
-     */
-    public function queryPostsByProperty($languageUid, $overlay, $expected)
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageUid($languageUid);
-        $querySettings->setLanguageOverlayMode($overlay);
-
-        $query->matching(
-            $query->logicalOr(
-                $query->like('title', 'Post 5%'),
-                $query->like('title', 'Post 6%'),
-                $query->like('title', 'Post DK only')
-            )
-        );
-        $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]);
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(count($expected), $posts);
-        $this->assertObjectsProperties($posts, $expected);
-    }
-
-    public function postsWithoutRespectingSysLanguageDataProvider()
-    {
-        $lang0Expected = [
-             [
-                 'title' => 'Blog 1',
-                 'uid' => 1,
-                 '_localizedUid' => 1,
-             ],
-             [
-                 'title' => 'Blog 1',
-                 'uid' => 1,
-                 '_localizedUid' => 1,
-             ],
-         ];
-        $lang1Expected = [
-             [
-                 'title' => 'Blog 1 DK',
-                 'uid' => 1,
-                 '_localizedUid' => 2,
-             ],
-             [
-                 'title' => 'Blog 1 DK',
-                 'uid' => 1,
-                 '_localizedUid' => 2,
-             ],
-         ];
-        return [
-             [
-                 'language' => 0,
-                 'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => null,
-                 'expected' => $lang0Expected
-             ],
-             [
-                 'language' => 0,
-                 'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => 'strict',
-                 'expected' => $lang0Expected
-             ],
-             [
-                 'language' => 0,
-                 'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => null,
-                 'expected' => $lang0Expected
-             ],
-             [
-                 'language' => 0,
-                 'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => 'strict',
-                 'expected' => $lang0Expected
-             ],
-             [
-                 'language' => 1,
-                 'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => null,
-                 'expected' => $lang1Expected
-             ],
-             [
-                 'language' => 1,
-                 'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => 'strict',
-                 'expected' => $lang1Expected
-             ],
-             [
-                 'language' => 1,
-                 'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => null,
-                 'expected' => $lang1Expected
-             ],
-             [
-                 'language' => 1,
-                 'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => 'strict',
-                 'expected' => $lang1Expected
-             ],
-         ];
-    }
-
-    /**
-     * This test demonstrates how query behaves when setRespectSysLanguage is set to false.
-     * The test now documents the wrong behaviour described in https://forge.typo3.org/issues/45873
-     * and is connected with https://forge.typo3.org/issues/59992
-     *
-     * The expected state is that when setRespectSysLanguage is false, then both: default language record,
-     * and translated language record should be returned. Now we're getting same record twice.
-     *
-     * @test
-     * @dataProvider postsWithoutRespectingSysLanguageDataProvider
-     * @param int $languageUid
-     * @param string|bool $overlay
-     * @param string $languageMode
-     * @param array $expected
-     */
-    public function postsWithoutRespectingSysLanguage($languageUid, $overlay, $languageMode, $expected)
-    {
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect($languageUid, $languageUid, $overlay));
-
-        $blogRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\BlogRepository::class);
-        $query = $blogRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageMode($languageMode);
-        $querySettings->setRespectSysLanguage(false);
-
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(count($expected), $posts);
-        $this->assertObjectsProperties($posts, $expected);
-    }
-
-    /**
-     * Compares array of domain objects with array containing properties values
-     *
-     * @param array $objects
-     * @param array $expected array of expected property values [ ['property' => 'value'], ['property' => 'value2']]
-     */
-    protected function assertObjectsProperties($objects, $expected)
-    {
-        $actual = [];
-        foreach ($objects as $key => $post) {
-            $actualPost = [];
-            $propertiesToCheck = array_keys($expected[$key]);
-            foreach ($propertiesToCheck as $propertyPath) {
-                $actualPost[$propertyPath] = self::getPropertyPath($post, $propertyPath);
-            }
-            $actual[] = $actualPost;
-            $this->assertEquals($expected[$key], $actual[$key], 'Assertion of the $expected[' . $key . '] failed');
-        }
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * This is a copy of the ObjectAccess::getPropertyPath, but with third argument of getPropertyInternal set as true,
-     * to access protected properties, and iterator_to_array added.
-     *
-     * @param mixed $subject Object or array to get the property path from
-     * @param string $propertyPath
-     *
-     * @return mixed Value of the property
-     */
-    protected static function getPropertyPath($subject, $propertyPath)
-    {
-        $propertyPathSegments = explode('.', $propertyPath);
-        try {
-            foreach ($propertyPathSegments as $pathSegment) {
-                $subject = ObjectAccess::getPropertyInternal($subject, $pathSegment, true);
-                if ($subject instanceof \SplObjectStorage || $subject instanceof ObjectStorage) {
-                    $subject = iterator_to_array(clone $subject, false);
-                }
-            }
-        } catch (\TYPO3\CMS\Extbase\Reflection\Exception\PropertyNotAccessibleException $error) {
-            return null;
-        }
-        return $subject;
-    }
-}
index d5115de..9b6fa45 100644 (file)
@@ -65,7 +65,6 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
 
         $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $configuration = [
-            'features' => ['consistentTranslationOverlayHandling' => 1],
             'persistence' => [
                 'storagePid' => 20,
                 'classes' => [
@@ -1082,31 +1081,26 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
              [
                  'language' => 0,
                  'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => null,
                  'expected' => $lang0Expected
              ],
              [
                  'language' => 0,
                  'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => 'strict',
                  'expected' => $lang0Expected
              ],
              [
                  'language' => 0,
                  'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => null,
                  'expected' => $mixed
              ],
              [
                  'language' => 0,
                  'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => 'strict',
                  'expected' => $mixed
              ],
              [
                  'language' => 1,
                  'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => null,
                  'expected' => [
                      [
                          'title' => 'Blog 1 DK',
@@ -1123,7 +1117,6 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
              [
                  'language' => 1,
                  'overlay' => LanguageAspect::OVERLAYS_ON,
-                 'mode' => 'strict',
                  'expected' => [
                      [
                          'title' => 'Blog 1 DK',
@@ -1140,13 +1133,6 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
              [
                  'language' => 1,
                  'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => null,
-                 'expected' => $mixed
-             ],
-             [
-                 'language' => 1,
-                 'overlay' => LanguageAspect::OVERLAYS_OFF,
-                 'mode' => 'strict',
                  'expected' => $mixed
              ],
          ];
@@ -1164,10 +1150,9 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
      * @dataProvider postsWithoutRespectingSysLanguageDataProvider
      * @param int $languageUid
      * @param string|bool $overlay
-     * @param string $languageMode
      * @param array $expected
      */
-    public function postsWithoutRespectingSysLanguage($languageUid, $overlay, $languageMode, $expected)
+    public function postsWithoutRespectingSysLanguage($languageUid, $overlay, $expected)
     {
         $context = GeneralUtility::makeInstance(Context::class);
         $context->setAspect('language', new LanguageAspect($languageUid, $languageUid, $overlay));
@@ -1175,7 +1160,6 @@ class QueryLocalizedDataTest extends \TYPO3\TestingFramework\Core\Functional\Fun
         $blogRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\BlogRepository::class);
         $query = $blogRepository->createQuery();
         $querySettings = $query->getQuerySettings();
-        $querySettings->setLanguageMode($languageMode);
         $querySettings->setRespectSysLanguage(false);
         $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]);
 
diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedContentLegacyTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedContentLegacyTest.php
deleted file mode 100644 (file)
index 4e149fb..0000000
+++ /dev/null
@@ -1,1243 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace TYPO3\CMS\Extbase\Tests\Functional\Persistence;
-
-/*
- * 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\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
-use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
-
-/**
- * This test is an Extbase version of the \TYPO3\CMS\Frontend\Tests\Functional\Rendering\LocalizedContentRenderingTest
- * scenarios are the same, just a way of fetching content is different
- *
- * This test documents current behaviour of extbase which is inconsistent with TypoScript rendering of tt_content.
- */
-class TranslatedContentLegacyTest extends AbstractDataHandlerActionTestCase
-{
-    const VALUE_PageId = 89;
-    const TABLE_Content = 'tt_content';
-    const TABLE_Pages = 'pages';
-
-    /**
-     * @var string
-     */
-    protected $scenarioDataSetDirectory = 'typo3/sysext/frontend/Tests/Functional/Rendering/DataSet/';
-
-    /**
-     * @var array
-     */
-    protected $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example'];
-
-    /**
-     * @var array
-     */
-    protected $coreExtensionsToLoad = ['extbase', 'fluid'];
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface The object manager
-     */
-    protected $objectManager;
-
-    /**
-     * @var \ExtbaseTeam\BlogExample\Domain\Repository\TtContentRepository
-     */
-    protected $contentRepository;
-
-    /**
-     * Custom 404 handler returning valid json is registered so the $this->getFrontendResponse()
-     * does not fail on 404 pages
-     *
-     * @var array
-     */
-    protected $configurationToUseInTestInstance = [
-        'FE' => [
-            'pageNotFound_handling' => 'READFILE:typo3/sysext/frontend/Tests/Functional/Rendering/DataSet/404Template.html'
-        ]
-    ];
-
-    /**
-     * @var array
-     */
-    protected $pathsToLinkInTestInstance = [
-        'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/AdditionalConfiguration.php' => 'typo3conf/AdditionalConfiguration.php',
-        'typo3/sysext/frontend/Tests/Functional/Fixtures/Images' => 'fileadmin/user_upload'
-    ];
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->importScenarioDataSet('LiveDefaultPages');
-        $this->importScenarioDataSet('LiveDefaultElements');
-
-        $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $this->contentRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\TtContentRepository::class);
-        $this->setUpFrontendRootPage(1, [
-            'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TypoScript/setup.typoscript',
-            'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/ContentJsonRenderer.typoscript'
-
-        ]);
-        $this->addTypoScriptToTemplateRecord(
-            1,
-            'config.tx_extbase.features.consistentTranslationOverlayHandling = 0'
-        );
-    }
-
-    protected function tearDown()
-    {
-        unset($this->objectManager);
-        unset($this->contentRepository);
-        parent::tearDown();
-    }
-
-    public function defaultLanguageConfigurationDataProvider(): array
-    {
-        return [
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode =',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback;1,0',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = strict',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = ignore',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode =',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback;1,0',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = strict',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = ignore',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode =',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback;1,0',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = strict',
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = ignore',
-            ],
-        ];
-    }
-
-    /**
-     * For the default language all combination of language settings should give the same result,
-     * regardless of TypoScript settings, if the requested language is "0" then no TypoScript settings apply.
-     *
-     * @test
-     * @dataProvider defaultLanguageConfigurationDataProvider
-     *
-     * @param string $typoScript
-     */
-    public function onlyEnglishContentIsRenderedForDefaultLanguage(string $typoScript)
-    {
-        $this->addTypoScriptToTemplateRecord(1, $typoScript);
-
-        $frontendResponse = $this->getFrontendResponse(self::VALUE_PageId, 0);
-        $responseSections = $frontendResponse->getResponseSections('Extbase:list()');
-        $visibleHeaders = ['Regular Element #1', 'Regular Element #2', 'Regular Element #3'];
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionHasRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$visibleHeaders)
-        );
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionDoesNotHaveRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$this->getNonVisibleHeaders($visibleHeaders))
-        );
-
-        //assert FAL relations
-        $visibleFiles = ['T3BOARD'];
-        $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':297')->setRecordField('image')
-                                                  ->setTable('sys_file_reference')->setField('title')->setValues(...$visibleFiles));
-
-        $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':297')->setRecordField('image')
-                                                  ->setTable('sys_file_reference')->setField('title')->setValues(...$this->getNonVisibleFileTitles($visibleFiles)));
-
-        $visibleFiles = ['Kasper2'];
-        $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':298')->setRecordField('image')
-                                                  ->setTable('sys_file_reference')->setField('title')->setValues(...$visibleFiles));
-
-        $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':298')->setRecordField('image')
-                                                  ->setTable('sys_file_reference')->setField('title')->setValues(...$this->getNonVisibleFileTitles($visibleFiles)));
-
-        //assert Categories
-        $visibleCategories = ['Category 1', 'Category 3 - not translated'];
-        $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':297')->setRecordField('categories')
-                                                  ->setTable('sys_category')->setField('title')->setValues(...$visibleCategories));
-
-        $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                  ->setRecordIdentifier(self::TABLE_Content . ':297')->setRecordField('categories')
-                                                  ->setTable('sys_category')->setField('title')->setValues(...$this->getNonVisibleCategoryTitles($visibleCategories)));
-    }
-
-    /**
-     * Dutch language has pages record and some content elements are translated
-     *
-     * @return array
-     */
-    public function dutchDataProvider(): array
-    {
-        //Expected behaviour:
-        //Page is translated to Dutch, so changing sys_language_mode does NOT change the results
-        //Page title is always [DK]Page, and both sys_language_content and sys_language_uid are always 1
-        return [
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                    config.sys_language_mode =',
-                'visibleRecords' => [
-                    // todo all uids are wrong, these should be the uids of the translations
-                    // todo the images are wrong as these should be translated
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    // todo as above, the wrong elements are shown and the images are not translated
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => [],
-                        'categories' => ['[Translate to Dansk:] Category 1'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            5 => [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode =',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            // Expected behaviour:
-            // Not translated element #2 is shown because sys_language_overlay = 1 (with sys_language_overlay = hideNonTranslated, it would be hidden)
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            // Expected behaviour:
-            // Same as config.sys_language_mode = content_fallback because we're requesting language 1, so no additional fallback possible
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => [],
-                        'categories' => ['[Translate to Dansk:] Category 1'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    // todo just wrong see other cases
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            // Expected behaviour:
-            // Non translated default language elements are not shown, because of hideNonTranslated.
-            // Here we see it's not working - Regular Element #2 is still shown despite it's not translated to Dansk
-            // The same with relations (images and categories)
-            10 => [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode =',
-                'visibleRecords' => [
-                    // todo too many records and wrong images
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    // todo same as #10
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    // todo same as #10
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            // Expected behaviour: Setting sys_language_mode = strict has the same effect as previous data sets,
-            // because the translation of the page exists
-            // This is not true in Extbase unfortunately. As visible here: sys_language_mode = strict, works like overlay = 0 in TypoScript rendering.
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [
-                    // todo same as #10
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => [],
-                        'categories' => ['[Translate to Dansk:] Category 1'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    // todo same as #10
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                        'categories' => ['[Translate to Dansk:] Category 1', 'Category 3 - not translated'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-        ];
-    }
-
-    /**
-     * @test
-     * @dataProvider dutchDataProvider
-     *
-     * @param string $typoScript
-     * @param array $visibleRecords
-     */
-    public function renderingOfDutchLanguage(string $typoScript, array $visibleRecords)
-    {
-        $this->addTypoScriptToTemplateRecord(1, $typoScript);
-        $frontendResponse = $this->getFrontendResponse(self::VALUE_PageId, 1);
-        $responseSections = $frontendResponse->getResponseSections('Extbase:list()');
-        $visibleHeaders = array_map(function ($element) {
-            return $element['header'];
-        }, $visibleRecords);
-
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionHasRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$visibleHeaders)
-        );
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionDoesNotHaveRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$this->getNonVisibleHeaders($visibleHeaders))
-        );
-
-        foreach ($visibleRecords as $ttContentUid => $properties) {
-            $visibleFileTitles = $properties['image'];
-            if (!empty($visibleFileTitles)) {
-                $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                          ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
-                                                          ->setTable('sys_file_reference')->setField('title')->setValues(...$visibleFileTitles));
-            }
-            $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                      ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
-                                                      ->setTable('sys_file_reference')->setField('title')->setValues(...$this->getNonVisibleFileTitles($visibleFileTitles)));
-
-            $visibleCategoryTitles = $properties['categories'] ?? [];
-            if (!empty($visibleCategoryTitles)) {
-                $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                          ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('categories')
-                                                          ->setTable('sys_category')->setField('title')->setValues(...$visibleCategoryTitles));
-            }
-            $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                      ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('categories')
-                                                      ->setTable('sys_category')->setField('title')->setValues(...$this->getNonVisibleCategoryTitles($visibleCategoryTitles)));
-        }
-    }
-
-    public function contentOnNonTranslatedPageDataProvider(): array
-    {
-        //Expected behaviour:
-        //the page is NOT translated so setting sys_language_mode to different values changes the results
-        //- setting sys_language_mode to empty value makes TYPO3 return default language records
-        //- setting it to strict throws 404, independently from other settings
-        //Setting config.sys_language_overlay = 0
-        return [
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode =',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    // todo there is something wrong with the result
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [],
-                'statusCode' => 404,
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    // todo there is something wrong with the result
-                    297 => [
-                        'header' => '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    304 => [
-                        'header' => '[DE] Without default language',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            5 => [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode =',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            //falling back to default language
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            //Dutch elements are shown because of the content fallback 1,0 - first Dutch, then default language
-            //note that '[DK] Without default language' is NOT shown - due to overlays (fetch default language and overlay it with translations)
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'], // todo this is wrong and should contain both translated images for #1
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper'] // todo this is wrong and should contain both translated images for #3
-                    ],
-                    // todo those records shouldn't be here at all
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [],
-                'statusCode' => 404
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    304 => [
-                        'header' => '[DE] Without default language',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            10 => [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode =',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => 'Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper'],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecords' => [
-                    // todo this is totally different to TS rendering, we shall see default content only
-                    // because the page is not translated and we have content_fallback active
-                    297 => [
-                        'header' => '[Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => '[Translate to Dansk:] Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    303 => [
-                        'header' => '[DK] Without default language',
-                        'image' => ['[T3BOARD] Image added to DK element without default language'],
-                    ],
-                    307 => [
-                        'header' => '[DK] UnHidden Element #4',
-                        'image' => [],
-                    ],
-                ],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = strict',
-                'visibleRecords' => [],
-                'statusCode' => 404,
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = ignore',
-                'visibleRecords' => [
-                    297 => [
-                        'header' => '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1',
-                        'image' => ['T3BOARD'],
-                    ],
-                    298 => [
-                        'header' => 'Regular Element #2',
-                        'image' => ['Kasper2'],
-                    ],
-                    299 => [
-                        'header' => 'Regular Element #3',
-                        'image' => ['Kasper']
-                    ],
-                    304 => [
-                        'header' => '[DE] Without default language',
-                        'image' => [],
-                    ],
-                ],
-            ],
-        ];
-    }
-
-    /**
-     * Page uid 89 is NOT translated to german
-     *
-     * @test
-     * @dataProvider contentOnNonTranslatedPageDataProvider
-     *
-     * @param string $typoScript
-     * @param array $visibleRecords
-     * @param int $statusCode '200' or '404'
-     */
-    public function contentOnNonTranslatedPageGerman(string $typoScript, array $visibleRecords, int $statusCode = 200)
-    {
-        $this->addTypoScriptToTemplateRecord(1, $typoScript);
-        $visibleHeaders = array_column($visibleRecords, 'header');
-
-        $response = $this->executeFrontendRequest(
-            (new InternalRequest())
-                ->withPageId(self::VALUE_PageId)
-                ->withLanguageId(2)
-        );
-
-        if ($statusCode === 200) {
-            $responseSections = ResponseContent::fromString((string)$response->getBody())
-                                               ->getSections('Extbase:list()');
-            $this->assertThat(
-                $responseSections,
-                $this->getRequestSectionHasRecordConstraint()
-                     ->setTable(self::TABLE_Content)
-                     ->setField('header')
-                     ->setValues(...$visibleHeaders)
-            );
-            $this->assertThat(
-                $responseSections,
-                $this->getRequestSectionDoesNotHaveRecordConstraint()
-                     ->setTable(self::TABLE_Content)
-                     ->setField('header')
-                     ->setValues(...$this->getNonVisibleHeaders($visibleHeaders))
-            );
-
-            foreach ($visibleRecords as $ttContentUid => $properties) {
-                $visibleFileTitles = $properties['image'];
-                if (!empty($visibleFileTitles)) {
-                    $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
-                                                              ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
-                                                              ->setTable('sys_file_reference')->setField('title')->setValues(...$visibleFileTitles));
-                }
-                $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
-                                                          ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
-                                                          ->setTable('sys_file_reference')->setField('title')->setValues(...$this->getNonVisibleFileTitles($visibleFileTitles)));
-            }
-        }
-
-        $this->assertEquals($statusCode, $response->getStatusCode());
-    }
-
-    public function contentOnPartiallyTranslatedPageDataProvider(): array
-    {
-
-        //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
-        return [
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode =',
-                'visibleRecordHeaders' => ['Regular Element #3', '[Translate to Polski:] Regular Element #1', '[PL] Without default language'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback',
-                'visibleRecordHeaders' => ['Regular Element #3', '[Translate to Polski:] Regular Element #1', '[PL] Without default language'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecordHeaders' => ['Regular Element #3', '[Translate to Polski:] Regular Element #1', '[PL] Without default language'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = strict',
-                'visibleRecordHeaders' => ['[Translate to Polski:] Regular Element #1', '[PL] Without default language'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 0
-                                config.sys_language_mode = ignore',
-                'visibleRecordHeaders' => ['Regular Element #3', '[Translate to Polski:] Regular Element #1', '[PL] Without default language'],
-            ],
-            5 => [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode =',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1', 'Regular Element #3'],
-            ],
-            // Expected behaviour:
-            // Not translated element #2 is shown because sys_language_overlay = 1 (with sys_language_overlay = hideNonTranslated, it would be hidden)
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1', 'Regular Element #3'],
-            ],
-//             Expected behaviour:
-//             Element #3 is not translated in PL and it is translated in DK. It's not shown as content_fallback is not related to single CE level
-//             but on page level - and this page is translated to Polish, so no fallback is happening
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1', 'Regular Element #3'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = strict',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = 1
-                                config.sys_language_mode = ignore',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1', 'Regular Element #3'],
-            ],
-            // Expected behaviour:
-            // Non translated default language elements are not shown, because of hideNonTranslated
-            10 => [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode =',
-                'visibleRecordHeaders' => ['[PL] Without default language', 'Regular Element #3', '[Translate to Polski:] Regular Element #1'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback',
-                'visibleRecordHeaders' => ['[PL] Without default language', 'Regular Element #3', '[Translate to Polski:] Regular Element #1'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = content_fallback;1,0',
-                'visibleRecordHeaders' => ['[PL] Without default language', 'Regular Element #3', '[Translate to Polski:] Regular Element #1'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = strict',
-                'visibleRecordHeaders' => ['[PL] Without default language', '[Translate to Polski:] Regular Element #1'],
-            ],
-            [
-                'typoScript' => 'config.sys_language_overlay = hideNonTranslated
-                                config.sys_language_mode = ignore',
-                'visibleRecordHeaders' => ['[PL] Without default language', 'Regular Element #3', '[Translate to Polski:] Regular Element #1'],
-            ]
-        ];
-    }
-
-    /**
-     * Page uid 89 is translated to to Polish, but not all CE are translated
-     *
-     * @test
-     * @dataProvider contentOnPartiallyTranslatedPageDataProvider
-     *
-     * @param string $typoScript
-     * @param array $visibleHeaders
-     */
-    public function contentOnPartiallyTranslatedPage(string $typoScript, array $visibleHeaders)
-    {
-        $this->addTypoScriptToTemplateRecord(1, $typoScript);
-
-        $frontendResponse = $this->getFrontendResponse(self::VALUE_PageId, 3);
-        $this->assertEquals('success', $frontendResponse->getStatus());
-        $responseSections = $frontendResponse->getResponseSections('Extbase:list()');
-
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionHasRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$visibleHeaders)
-        );
-        $this->assertThat(
-            $responseSections,
-            $this->getRequestSectionDoesNotHaveRecordConstraint()
-                 ->setTable(self::TABLE_Content)
-                 ->setField('header')
-                 ->setValues(...$this->getNonVisibleHeaders($visibleHeaders))
-        );
-    }
-
-    /**
-     * Helper function to ease asserting that rest of the data set is not visible
-     *
-     * @param array $visibleHeaders
-     * @return array
-     */
-    protected function getNonVisibleHeaders(array $visibleHeaders): array
-    {
-        $allElements = [
-            'Regular Element #1',
-            'Regular Element #2',
-            'Regular Element #3',
-            'Hidden Element #4',
-            '[Translate to Dansk:] Regular Element #1',
-            '[Translate to Dansk:] Regular Element #3',
-            '[DK] Without default language',
-            '[DK] UnHidden Element #4',
-            '[DE] Without default language',
-            '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1',
-            '[Translate to Polski:] Regular Element #1',
-            '[PL] Without default language',
-            '[PL] Hidden Regular Element #2'
-        ];
-        return array_diff($allElements, $visibleHeaders);
-    }
-
-    /**
-     * Helper function to ease asserting that rest of the data set is not visible
-     *
-     * @param array $visibleTitles
-     * @return array
-     */
-    protected function getNonVisibleFileTitles(array $visibleTitles): array
-    {
-        $allElements = [
-            'T3BOARD',
-            'Kasper',
-            '[Kasper] Image translated to Dansk',
-            '[T3BOARD] Image added in Dansk (without parent)',
-            '[T3BOARD] Image added to DK element without default language',
-            '[T3BOARD] image translated to DE from DK',
-            'Kasper2'
-        ];
-        return array_diff($allElements, $visibleTitles);
-    }
-
-    /**
-     * Helper function to ease asserting that rest of the data set is not visible
-     *
-     * @param array $visibleTitles
-     * @return array
-     */
-    protected function getNonVisibleCategoryTitles(array $visibleTitles): array
-    {
-        $allElements = [
-            'Category 1',
-            '[Translate to Dansk:] Category 1',
-            'Category 3 - not translated',
-            'Category 4',
-        ];
-        return array_diff($allElements, $visibleTitles);
-    }
-}
index df8c6e9..9fdbb3a 100644 (file)
@@ -94,10 +94,6 @@ class TranslatedContentTest extends AbstractDataHandlerActionTestCase
             'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/ContentJsonRenderer.typoscript'
 
         ]);
-        $this->addTypoScriptToTemplateRecord(
-            1,
-            'config.tx_extbase.features.consistentTranslationOverlayHandling = 1'
-        );
     }
 
     protected function tearDown()
diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationLegacyTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationLegacyTest.php
deleted file mode 100644 (file)
index b99c059..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Extbase\Tests\Functional\Persistence;
-
-/*
- * 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 ExtbaseTeam\BlogExample\Domain\Model\Post;
-use PHPUnit\Framework\MockObject\MockObject;
-use TYPO3\CMS\Core\Context\Context;
-use TYPO3\CMS\Core\Context\LanguageAspect;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Persistence\QueryInterface;
-use TYPO3\CMS\Extbase\Service\EnvironmentService;
-use TYPO3\CMS\Frontend\Page\PageRepository;
-
-class TranslationLegacyTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
-{
-    /**
-     * @var array
-     */
-    protected $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example'];
-
-    /**
-     * @var array
-     */
-    protected $coreExtensionsToLoad = ['extbase', 'fluid'];
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface The object manager
-     */
-    protected $objectManager;
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Persistence\Repository
-     */
-    protected $postRepository;
-
-    /**
-     * Sets up this test suite.
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-        /*
-         * Posts Dataset for the tests:
-         *
-         * Post1
-         *   -> EN: Post1
-         *   -> GR: Post1
-         * Post2
-         *   -> EN: Post2
-         * Post3
-         * Post10 [hidden]
-         *   -> GR: Post10 [hidden]
-         */
-        $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml');
-        $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml');
-        $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.xml');
-        $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.xml');
-        $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.xml');
-
-        $this->setUpBasicFrontendEnvironment();
-
-        $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $configuration = [
-            'features' => ['consistentTranslationOverlayHandling' => 0]
-        ];
-        $configurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
-        $configurationManager->setConfiguration($configuration);
-
-        $this->postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
-    }
-
-    /**
-     * Minimal frontend environment to satisfy Extbase Typo3DbBackend
-     */
-    protected function setUpBasicFrontendEnvironment()
-    {
-        // in v9 overlay and language mode has different default values, so we need to set them here explicitely
-        // to match v8 behaviour
-        $context = GeneralUtility::makeInstance(Context::class);
-        $context->setAspect('language', new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_OFF, ['off']));
-
-        /** @var MockObject|EnvironmentService $environmentServiceMock */
-        $environmentServiceMock = $this->createMock(EnvironmentService::class);
-        $environmentServiceMock
-            ->expects($this->atLeast(1))
-            ->method('isEnvironmentInFrontendMode')
-            ->willReturn(true);
-        GeneralUtility::setSingletonInstance(EnvironmentService::class, $environmentServiceMock);
-
-        $pageRepositoryFixture = new PageRepository();
-        $frontendControllerMock = $this->createMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class);
-        $frontendControllerMock->sys_page = $pageRepositoryFixture;
-        $GLOBALS['TSFE'] = $frontendControllerMock;
-    }
-
-    /**
-     * Tests if repository returns correct number of posts in the default language
-     *
-     * @test
-     */
-    public function countReturnsCorrectNumberOfPosts()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(0);
-
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $postCount = $query->execute()->count();
-        $this->assertSame(3, $postCount);
-    }
-
-    /**
-     * This test shows the difference between old and new rendering
-     * languageMode is now ignored, overlay is `false`, so this test is the same
-     * as countReturnsCorrectNumberOfPostsInEnglishLanguage
-     *
-     * @test
-     */
-    public function countReturnsCorrectNumberOfPostsInEnglishLanguageForStrictMode()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageMode('strict');
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-
-        $postCount = $query->execute()->count();
-        $this->assertSame(2, $postCount);
-    }
-
-    /**
-     * Test for fetching records with disabled overlay
-     *
-     * @test
-     */
-    public function countReturnsCorrectNumberOfPostsInEnglishLanguage()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(1);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $postCount = $query->execute()->count();
-        $this->assertSame(3, $postCount);
-    }
-
-    /**
-     * @test
-     */
-    public function countReturnsCorrectNumberOfPostsInGreekLanguage()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(2);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $postCount = $query->execute()->count();
-
-        $this->assertSame(3, $postCount);
-    }
-
-    /**
-     * @test
-     */
-    public function fetchingPostsReturnsEnglishPostsWithFallback()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(1);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(3, $posts);
-        $this->assertSame('A EN:Post2', $posts[0]->getTitle());
-        $this->assertSame('B EN:Post1', $posts[1]->getTitle());
-        $this->assertSame('Post3', $posts[2]->getTitle());
-    }
-
-    /**
-     * This tests shows overlays in action
-     *
-     * @test
-     */
-    public function fetchingPostsReturnsGreekPostsWithFallback()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(2);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(3, $posts);
-        $this->assertSame('GR:Post1', $posts[0]->getTitle());
-        $this->assertSame('Post2', $posts[1]->getTitle());
-        $this->assertSame('Post3', $posts[2]->getTitle());
-    }
-
-    /**
-     * This tests shows overlay 'hideNonTranslated' in action
-     *
-     * @test
-     */
-    public function fetchingPostsReturnsGreekPostsWithHideNonTranslated()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(2);
-        $querySettings->setLanguageOverlayMode('hideNonTranslated');
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(3, $posts);
-        $this->assertSame('GR:Post1', $posts[0]->getTitle());
-        $this->assertSame('Post2', $posts[1]->getTitle());
-        $this->assertSame('Post3', $posts[2]->getTitle());
-    }
-
-    /**
-     * @test
-     */
-    public function orderingByTitleRespectsEnglishTitles()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(1);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(3, $posts);
-        $this->assertSame('A EN:Post2', $posts[0]->getTitle());
-        $this->assertSame('B EN:Post1', $posts[1]->getTitle());
-        $this->assertSame('Post3', $posts[2]->getTitle());
-    }
-
-    /**
-     * This test checks whether setIgnoreEnableFields(true) affects the query
-     * It's expected that when ignoring enable fields, the hidden record is also returned.
-     * This is related to https://forge.typo3.org/issues/68672
-     *
-     * @test
-     */
-    public function fetchingHiddenPostsWithIgnoreEnableField()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setIgnoreEnableFields(true);
-        $querySettings->setLanguageUid(0);
-        //we need it to have stable results on pgsql
-        $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[] $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(4, $posts);
-        $this->assertSame('Post10', $posts[3]->getTitle());
-    }
-
-    /**
-     * This test checks whether setIgnoreEnableFields(true) affects translated record too.
-     * It's expected that when ignoring enable fields, the hidden translated record is shown.
-     * This is related to https://forge.typo3.org/issues/68672
-     *
-     * This tests documents current, buggy behaviour!
-     *
-     * @test
-     */
-    public function fetchingHiddenPostsReturnsHiddenOverlay()
-    {
-        $query = $this->postRepository->createQuery();
-
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setIgnoreEnableFields(true);
-        $querySettings->setLanguageUid(2);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        //we need it to have stable results on pgsql
-        $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]);
-
-        /** @var Post[] $posts */
-        $posts = $query->execute()->toArray();
-
-        $this->assertCount(4, $posts);
-        //This assertion is wrong, once the issue https://forge.typo3.org/issues/68672
-        //is fixed, the following assertion should be used.
-        $this->assertSame('Post10', $posts[3]->getTitle());
-        //$this->assertSame('GR:Post10', $posts[3]->getTitle());
-    }
-
-    /**
-     * Test checking if we can query db records by translated fields
-     *
-     * @test
-     */
-    public function fetchingTranslatedPostByTitle()
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setStoragePageIds([1]);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(2);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-        $query->matching($query->equals('title', 'GR:Post1'));
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-        $this->assertCount(1, $posts);
-        $this->assertSame('GR:Post1', $posts[0]->getTitle());
-    }
-
-    /**
-     * @test
-     */
-    public function fetchingPostByTagName()
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setRespectStoragePage(false);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(0);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-        $query->matching($query->equals('tags.name', 'Tag1'));
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-        $this->assertCount(3, $posts);
-        $this->assertSame('Post1', $posts[0]->getTitle());
-    }
-
-    /**
-     * @test
-     */
-    public function fetchingTranslatedPostByTagName()
-    {
-        $query = $this->postRepository->createQuery();
-        $querySettings = $query->getQuerySettings();
-        $querySettings->setRespectStoragePage(false);
-        $querySettings->setRespectSysLanguage(true);
-        $querySettings->setLanguageUid(1);
-        $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
-
-        $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
-        $query->matching($query->equals('tags.name', 'Tag1'));
-        /** @var Post[]|array $posts */
-        $posts = $query->execute()->toArray();
-        $this->assertCount(3, $posts);
-        $this->assertSame('A EN:Post2', $posts[0]->getTitle());
-        $this->assertSame('Post3', $posts[2]->getTitle());
-    }
-}
index 26dfa88..f790567 100644 (file)
@@ -73,11 +73,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $this->setUpBasicFrontendEnvironment();
 
         $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $configuration = [
-            'features' => ['consistentTranslationOverlayHandling' => 1]
-        ];
-        $configurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
-        $configurationManager->setConfiguration($configuration);
         $this->postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
     }
 
@@ -120,7 +115,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setLanguageUid(0);
 
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $postCount = $query->execute()->count();
         $this->assertSame(3, $postCount);
@@ -141,7 +135,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setStoragePageIds([1]);
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(1);
-        $querySettings->setLanguageMode('strict');
         $this->assertFalse($querySettings->getLanguageOverlayMode());
 
         $postCount = $query->execute()->count();
@@ -163,7 +156,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setLanguageUid(1);
 
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $postCount = $query->execute()->count();
         $this->assertSame(2, $postCount);
@@ -181,7 +173,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(2);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $postCount = $query->execute()->count();
 
@@ -200,7 +191,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(1);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
 
@@ -226,7 +216,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(2);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
 
@@ -251,7 +240,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(2);
         $querySettings->setLanguageOverlayMode('hideNonTranslated');
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
 
@@ -274,7 +262,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(1);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
 
@@ -301,7 +288,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(1);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings([
             'blog.title' => QueryInterface::ORDER_ASCENDING,
@@ -417,7 +403,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(2);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
         $query->matching($query->equals('title', 'GR:Post1'));
@@ -441,7 +426,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(2);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
         $query->matching($query->equals('blog.title', 'Blog1'));
@@ -462,7 +446,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(0);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
         $query->matching($query->equals('tags.name', 'Tag1'));
@@ -483,7 +466,6 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $querySettings->setRespectSysLanguage(true);
         $querySettings->setLanguageUid(1);
         $this->assertFalse($querySettings->getLanguageOverlayMode());
-        $this->assertNull($querySettings->getLanguageMode());
 
         $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
         $query->matching($query->equals('tags.name', 'Tag1'));
index 05f32d5..8d3053f 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage;
 use Doctrine\DBAL\Driver\Statement;
 use Prophecy\Argument;
 use TYPO3\CMS\Core\Context\Context;
-use TYPO3\CMS\Core\Context\WorkspaceAspect;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
@@ -132,51 +131,4 @@ class Typo3DbBackendTest extends UnitTestCase
         $result = $mockTypo3DbBackend->_callRef('getUidOfAlreadyPersistedValueObject', $mockValueObject);
         $this->assertSame($expectedUid, $result);
     }
-
-    /**
-     * @test
-     */
-    public function doLanguageAndWorkspaceOverlayChangesUidIfInPreview()
-    {
-        $comparisonRow = [
-            'uid' => '42',
-            'pid' => '42',
-            '_ORIG_pid' => '-1',
-            '_ORIG_uid' => '43'
-        ];
-        $row = [
-            'uid' => '42',
-            'pid' => '42'
-        ];
-        $workspaceVersion = [
-            'uid' => '43',
-            'pid' => '-1'
-        ];
-        /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings|\PHPUnit_Framework_MockObject_MockObject $querySettings */
-        $mockQuerySettings = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)
-            ->setMethods(['dummy'])
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $workspaceUid = 2;
-
-        $objectManagerMock = $this->getMockBuilder(ObjectManager::class)
-            ->disableOriginalConstructor()
-            ->getMock();
-        $sourceMock = new \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Selector('tx_foo', 'Tx_Foo');
-        $context = new Context([
-            'workspace' => new WorkspaceAspect($workspaceUid)
-        ]);
-        /** @var $pageRepositoryMock PageRepository|\PHPUnit_Framework_MockObject_MockObject */
-        $pageRepositoryMock = $this->getMockBuilder(PageRepository::class)
-            ->setMethods(['movePlhOL', 'getWorkspaceVersionOfRecord'])
-            ->setConstructorArgs([$context])
-            ->getMock();
-        $pageRepositoryMock->expects($this->once())->method('getWorkspaceVersionOfRecord')->with($workspaceUid, 'tx_foo', '42')->will($this->returnValue($workspaceVersion));
-        $objectManagerMock->expects($this->at(0))->method('get')->with(Context::class)->willReturn($context);
-        $objectManagerMock->expects($this->at(1))->method('get')->with(PageRepository::class, $context)->willReturn($pageRepositoryMock);
-        $mockTypo3DbBackend = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::class, ['dummy'], [], '', false);
-        $mockTypo3DbBackend->injectObjectManager($objectManagerMock);
-        $this->assertSame([$comparisonRow], $mockTypo3DbBackend->_call('doLanguageAndWorkspaceOverlay', $sourceMock, [$row], $mockQuerySettings));
-    }
 }
index 8fa8b8c..146d872 100644 (file)
@@ -342,7 +342,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForDefaultLanguage()
+    public function addGetLanguageStatementWorksForDefaultLanguage()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -353,7 +353,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderWithExpressionBuilderProphet();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
+        $sql = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
         $expectedSql = $table . '.sys_language_uid IN (0, -1)';
         $this->assertSame($expectedSql, $sql);
     }
@@ -361,7 +361,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForNonDefaultLanguage()
+    public function addGetLanguageStatementWorksForNonDefaultLanguage()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -375,7 +375,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderWithExpressionBuilderProphet();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
+        $sql = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
         $result = $table . '.sys_language_uid IN (1, -1)';
         $this->assertSame($result, $sql);
     }
@@ -383,7 +383,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable()
+    public function addGetLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -393,7 +393,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderWithExpressionBuilderProphet();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
+        $sql = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
         $expectedSql = $table . '.sys_language_uid IN (0, -1)';
         $this->assertSame($expectedSql, $sql);
     }
@@ -401,7 +401,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned()
+    public function addGetLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -413,7 +413,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderWithExpressionBuilderProphet();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
+        $sql = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
         $expectedSql = $table . '.sys_language_uid IN (0, -1)';
         $this->assertSame($expectedSql, $sql);
     }
@@ -421,7 +421,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForForeignLanguageWithoutSubselection()
+    public function addGetLanguageStatementWorksForForeignLanguageWithoutSubselection()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -432,7 +432,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderWithExpressionBuilderProphet();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
+        $sql = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
         $expectedSql = $table . '.sys_language_uid IN (2, -1)';
         $this->assertSame($expectedSql, $sql);
     }
@@ -440,7 +440,7 @@ class Typo3DbQueryParserTest extends UnitTestCase
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned()
+    public function addGetLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -455,15 +455,15 @@ class Typo3DbQueryParserTest extends UnitTestCase
 
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
 
-        $compositeExpression = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
-        $expectedSql = '(' . $table . '.sys_language_uid IN (2, -1)) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '.l10n_parent FROM ' . $table . ' WHERE (' . $table . '.l10n_parent > 0) AND (' . $table . '.sys_language_uid = 2))))';
+        $compositeExpression = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
+        $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2))))';
         $this->assertSame($expectedSql, $compositeExpression->__toString());
     }
 
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
+    public function addGetLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
     {
         $table = $this->getUniqueId('tx_coretest_table');
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -476,20 +476,15 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
         $queryBuilderProphet = $this->getQueryBuilderProphetWithQueryBuilderForSubselect();
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $compositeExpression= $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
-        $expectedSql =  '(' . $table . '.sys_language_uid IN (2, -1))' .
-                ' OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (' .
-                'SELECT ' . $table . '.l10n_parent FROM ' . $table .
-                ' WHERE (' . $table . '.l10n_parent > 0) AND (' .
-                $table . '.sys_language_uid = 2) AND (' .
-                $table . '.deleted = 0))))';
+        $compositeExpression= $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
+        $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0) AND (' . $table . '_dl.deleted = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2) AND ((' . $table . '_dl.deleted = 0) AND (' . $table . '_to.deleted = 0)))))';
         $this->assertSame($expectedSql, $compositeExpression->__toString());
     }
 
     /**
      * @test
      */
-    public function addSysLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
+    public function addGetLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
     {
         $table = 'tt_content';
         $GLOBALS['TCA'][$table]['ctrl'] = [
@@ -504,13 +499,8 @@ class Typo3DbQueryParserTest extends UnitTestCase
         $queryBuilderProphet = $this->getQueryBuilderProphetWithQueryBuilderForSubselect();
 
         $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
-        $compositeExpression = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
-        $expectedSql = '(' . $table . '.sys_language_uid IN (2, -1))' .
-                ' OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (' .
-                'SELECT ' . $table . '.l10n_parent FROM ' . $table .
-                ' WHERE (' . $table . '.l10n_parent > 0) AND (' .
-                $table . '.sys_language_uid = 2) AND (' .
-                $table . '.deleted = 0))))';
+        $compositeExpression = $mockTypo3DbQueryParser->_callRef('getLanguageStatement', $table, $table, $querySettings);
+        $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0) AND (' . $table . '_dl.deleted = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2) AND ((' . $table . '_dl.deleted = 0) AND (' . $table . '_to.deleted = 0)))))';
         $this->assertSame($expectedSql, $compositeExpression->__toString());
     }
 
index 914329e..4cb1f9b 100644 (file)
@@ -95,8 +95,5 @@ config.tx_extbase {
                ignoreAllEnableFieldsInBe = 0
                # Should be on by default, but can be disabled if all action in the plugin are uncached
                requireCHashArgumentForActionArguments = 1
-               # if enabled Extbase language overlays should behave the same as in TypoScript rendering
-               # In v10 the flag will be removed, thus new way will be the default
-               consistentTranslationOverlayHandling = 1
        }
 }