Commit 5b306d4a authored by Tymoteusz Motylewski's avatar Tymoteusz Motylewski
Browse files

[TASK] Update localization rendering tests to newest Testing Framework

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
parent d315fb23
......@@ -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']]
);
}
}
......@@ -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']]
);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment