-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] prevent changing language fields for container children
Fixes: #499
- Loading branch information
1 parent
8d1036b
commit 8377274
Showing
3 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
Tests/Functional/Datahandler/Localization/ConnectedMode/ContainerChildrenTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Container\Tests\Functional\Datahandler\Localization\ConnectedMode; | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "container" by b13. | ||
* | ||
* 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. | ||
*/ | ||
|
||
use B13\Container\Tests\Functional\Datahandler\AbstractDatahandler; | ||
|
||
class ContainerChildrenTest extends AbstractDatahandler | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function cannotChangeLanguageOfTranslatedChild(): void | ||
{ | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/ContainerChildren/translated_container_with_children.csv'); | ||
$datamap = [ | ||
'tt_content' => [ | ||
22 => [ | ||
'sys_language_uid' => 0, | ||
], | ||
], | ||
]; | ||
$this->dataHandler->start($datamap, [], $this->backendUser); | ||
$this->dataHandler->process_datamap(); | ||
self::assertCSVDataSet(__DIR__ . '/Fixtures/ContainerChildren/translated_container_with_children.csv'); | ||
self::assertNotEmpty($this->dataHandler->errorLog, 'dataHander error log is empty'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function cannotChangeL18nParentOfTranslatedChild(): void | ||
{ | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/ContainerChildren/translated_container_with_children.csv'); | ||
$datamap = [ | ||
'tt_content' => [ | ||
22 => [ | ||
'l18n_parent' => 1, | ||
], | ||
], | ||
]; | ||
$this->dataHandler->start($datamap, [], $this->backendUser); | ||
$this->dataHandler->process_datamap(); | ||
self::assertCSVDataSet(__DIR__ . '/Fixtures/ContainerChildren/translated_container_with_children.csv'); | ||
self::assertNotEmpty($this->dataHandler->errorLog, 'dataHander error log is empty'); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...alization/ConnectedMode/Fixtures/ContainerChildren/translated_container_with_children.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"pages" | ||
,"uid","pid","title","slug","sys_language_uid","l10n_parent","l10n_source" | ||
,1,0,"page-1","/",0,0,0 | ||
,2,0,"page-1-language-1","/",1,1,1 | ||
"tt_content" | ||
,"uid","pid","CType","header","sorting","sys_language_uid","colPos","tx_container_parent","l18n_parent" | ||
,1,1,"b13-2cols-with-header-container","container-default",256,0,0,0,0 | ||
,2,1,"header","header-default",128,0,200,1,0 | ||
,21,1,"b13-2cols-with-header-container","container-language-1",256,1,0,0,1 | ||
,22,1,"header","header-language-1",128,1,200,1,2 |