[TASK] Update localization rendering tests to newest Testing Framework 51/54051/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Sat, 9 Sep 2017 10:20:18 +0000 (12:20 +0200)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Sat, 9 Sep 2017 11:20:50 +0000 (13:20 +0200)
addTypoScriptToTemplateRecord method was added to FunctionalTestCase.php
in Testing Framework.
So we can remove it from test cases.
Fix two other germlins also (unneeded comment and unused variable).

Resolves: #82401
Releases: master, 8.7, 7.6
Change-Id: I8144bae5a807d60123ef5228a44eba579a7705c7
Reviewed-on: https://review.typo3.org/54051
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedContentTest.php
typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedContentRenderingTest.php

index 09c8f17..43d5689 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Extbase\Tests\Functional\Persistence;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Response;
 
@@ -882,7 +881,6 @@ class TranslatedContentTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandlin
             [
                 'typoScript' => 'config.sys_language_overlay = hideNonTranslated
                                 config.sys_language_mode = content_fallback;1,0',
-//                'visibleRecordHeaders' => ['[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #3', 'Regular Element #2', '[DK] Without default language', '[DK] UnHidden Element #4'],
                 'visibleRecords' => [
                     297 => [
                         'header' => '[Translate to Dansk:] Regular Element #1',
@@ -979,7 +977,6 @@ class TranslatedContentTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandlin
                         ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
                         ->setTable('sys_file_reference')->setField('title')->setValues(...$visibleFileTitles));
                 }
-                $dd = $this->getNonVisibleFileTitles($visibleFileTitles);
                 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
                     ->setRecordIdentifier(self::TABLE_Content . ':' . $ttContentUid)->setRecordField('image')
                     ->setTable('sys_file_reference')->setField('title')->setValues(...$this->getNonVisibleFileTitles($visibleFileTitles)));
@@ -1158,26 +1155,4 @@ class TranslatedContentTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandlin
         ];
         return array_diff($allElements, $visibleTitles);
     }
-
-    /**
-     * Adds TypoScript setup snippet to the existing template record
-     *
-     * @param int $pageId
-     * @param string $typoScript
-     */
-    protected function addTypoScriptToTemplateRecord(int $pageId, string $typoScript)
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template');
-
-        $template = $connection->select(['*'], 'sys_template', ['pid' => $pageId, 'root' => 1])->fetch();
-        if (empty($template)) {
-            $this->fail('Cannot find root template on page with id: "' . $pageId . '"');
-        }
-        $updateFields['config'] = $template['config'] . LF . $typoScript;
-        $connection->update(
-            'sys_template',
-            $updateFields,
-            ['uid' => $template['uid']]
-        );
-    }
 }
index 31e52e1..fa171f6 100644 (file)
@@ -16,8 +16,6 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\Rendering;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Response;
 
 /**
@@ -1230,26 +1228,4 @@ class LocalizedContentRenderingTest extends \TYPO3\CMS\Core\Tests\Functional\Dat
         ];
         return array_diff($allElements, $visibleTitles);
     }
-
-    /**
-     * Adds TypoScript setup snippet to the existing template record
-     *
-     * @param int $pageId
-     * @param string $typoScript
-     */
-    protected function addTypoScriptToTemplateRecord(int $pageId, string $typoScript)
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template');
-
-        $template = $connection->select(['*'], 'sys_template', ['pid' => $pageId, 'root' => 1])->fetch();
-        if (empty($template)) {
-            $this->fail('Cannot find root template on page with id: "' . $pageId . '"');
-        }
-        $updateFields['config'] = $template['config'] . LF . $typoScript;
-        $connection->update(
-            'sys_template',
-            $updateFields,
-            ['uid' => $template['uid']]
-        );
-    }
 }