-
Notifications
You must be signed in to change notification settings - Fork 640
/
AbstractActionTestCase.php
919 lines (783 loc) · 45.1 KB
/
AbstractActionTestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
<?php
declare(strict_types=1);
/*
* 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!
*/
namespace TYPO3\CMS\Core\Tests\Functional\DataScenarios\Regular;
use TYPO3\CMS\Core\Configuration\Tca\TcaMigration;
use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Tests\Functional\DataScenarios\AbstractDataHandlerActionTestCase;
use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
{
use SiteBasedTestTrait;
protected const VALUE_PageIdParent = 88;
protected const VALUE_PageId = 89;
protected const VALUE_PageIdTarget = 90;
protected const VALUE_PageIdWebsite = 1;
protected const VALUE_ContentIdParent = 296;
protected const VALUE_ContentIdFirst = 297;
protected const VALUE_ContentIdSecond = 298;
protected const VALUE_ContentIdThird = 299;
protected const VALUE_ContentIdThirdLocalized = 300;
protected const VALUE_ContentIdFreeMode = 310;
protected const VALUE_LanguageId = 1;
protected const VALUE_LanguageIdSecond = 2;
protected const TABLE_Page = 'pages';
protected const TABLE_Content = 'tt_content';
protected const SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefault.csv';
protected function setUp(): void
{
parent::setUp();
// Show copied pages records in frontend request
$GLOBALS['TCA']['pages']['ctrl']['hideAtCopy'] = false;
// Show copied tt_content records in frontend request
$GLOBALS['TCA']['tt_content']['ctrl']['hideAtCopy'] = false;
$this->importCSVDataSet(static::SCENARIO_DataSet);
$this->writeSiteConfiguration(
'test',
$this->buildSiteConfiguration(1, '/'),
[
$this->buildDefaultLanguageConfiguration('EN', '/'),
$this->buildLanguageConfiguration('DA', '/da/', ['EN']),
$this->buildLanguageConfiguration('DE', '/de/', ['DA', 'EN']),
]
);
$this->setUpFrontendRootPage(1, ['EXT:core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
}
/**
* Content records
*/
/**
* Create a content record
*/
public function createContents(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
// Creating record at the beginning of the page
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']);
$this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][0];
// Creating record at the end of the page (after last one)
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, -self::VALUE_ContentIdSecond, ['header' => 'Testing #2']);
$this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][0];
}
/**
* Creation of a content element with language set to all
*
* See DataSet/createContentForLanguageAll.csv
*/
public function createContentForLanguageAll(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Language set to all', 'sys_language_uid' => -1]);
$this->recordIds['newContentLanguageAll'] = $newTableIds[self::TABLE_Content][0];
}
public function modifyContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
}
/**
* See DataSet/modifyTranslatedContent.csv
*/
public function modifyTranslatedContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, ['header' => 'Testing Translation #3']);
}
public function hideContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['hidden' => '1']);
}
public function deleteContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
}
public function deleteLocalizedContentAndDeleteContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized);
$this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThird);
}
public function copyContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId);
$this->recordIds['copiedContentId'] = $copiedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
public function copyContentToLanguage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$copiedTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $copiedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
/**
* See DataSet/copyContentToLanguageWSynchronization.csv
*/
public function copyContentToLanguageWithLanguageSynchronization(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$copiedTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $copiedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
}
/**
* See DataSet/copyContentToLanguageWExclude.csv
*/
public function copyContentToLanguageWithLocalizationExclude(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = 'exclude';
$copiedTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $copiedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
}
/**
* Free mode "translation" of a record in non default language
*/
public function copyContentToLanguageFromNonDefaultLanguage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$copiedTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, self::VALUE_LanguageIdSecond);
$this->recordIds['localizedContentId'] = $copiedTableIds[self::TABLE_Content][self::VALUE_ContentIdThirdLocalized];
}
/**
* See DataSet/copyPasteContent.csv
*/
public function copyPasteContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId, ['header' => 'Testing #1']);
}
public function localizeContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
public function localizeContentWithHideAtCopy(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA'][self::TABLE_Content]['ctrl']['hideAtCopy'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$this->actionService->modifyRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], ['hidden' => 0]);
}
/**
* @see \TYPO3\CMS\Core\Configuration\Tca\TcaMigration::sanitizeControlSectionIntegrity()
*/
public function localizeContentWithEmptyTcaIntegrityColumns(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$integrityFieldNames = [
'language' => $GLOBALS['TCA'][self::TABLE_Content]['ctrl']['languageField'] ?? null,
'languageParent' => $GLOBALS['TCA'][self::TABLE_Content]['ctrl']['transOrigPointerField'] ?? null,
'languageSource' => $GLOBALS['TCA'][self::TABLE_Content]['ctrl']['translationSource'] ?? null,
];
// explicitly unset integrity columns in TCA
foreach ($integrityFieldNames as $integrityFieldName) {
unset($GLOBALS['TCA'][self::TABLE_Content]['columns'][$integrityFieldName]);
}
// After TCA changes, refindex is not ok anymore for imported rows. Update it before performing other actions.
$referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
$referenceIndex->updateIndex(false);
// explicitly call TcaMigration (which was executed already earlier in functional testing bootstrap)
$GLOBALS['TCA'] = (new TcaMigration())->migrate($GLOBALS['TCA']);
// perform actions to be tested
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
public function localizeContentWithLanguageSynchronization(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
}
public function localizeContentWithLanguageSynchronizationHavingNullValue(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['nullable'] = true;
$GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['behaviour']['allowLanguageSynchronization'] = true;
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['bodytext' => null]);
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
}
public function localizeContentFromNonDefaultLanguage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, self::VALUE_LanguageIdSecond);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdThirdLocalized];
}
public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, self::VALUE_LanguageIdSecond);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdThirdLocalized];
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdThird, ['header' => 'Testing #1']);
}
public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, self::VALUE_LanguageIdSecond);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdThirdLocalized];
$this->actionService->modifyRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], ['l10n_state' => ['header' => 'source']]);
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdThird, ['header' => 'Testing #1']);
}
/**
* Test for issue https://forge.typo3.org/issues/83079 - sorting of 'localization of localization' should
* use the sort value of the source record for the first localized record, and sort value of 'previous'
* record of target language for subsequent records.
*/
public function localizeContentFromNonDefaultLanguageWithAllContentElements(): void
{
// Run test without translations: We want to create all the lang 1 and lang 2 content elements
// with one DH call in one go per language.
$this->setWorkspaceId(0);
if (defined('static::VALUE_WorkspaceId') > 0) {
$this->setWorkspaceId(static::VALUE_WorkspaceId);
}
// @todo: This should be extracted as localizeRecords() in addition to localizeRecord() to ActionService
// Create localization of the 3 default language content elements
$commandMap = [
'tt_content' => [
self::VALUE_ContentIdFirst => [ 'localize' => self::VALUE_LanguageId],
self::VALUE_ContentIdSecond => [ 'localize' => self::VALUE_LanguageId],
self::VALUE_ContentIdThird => [ 'localize' => self::VALUE_LanguageId],
],
];
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->start([], $commandMap);
$dataHandler->process_cmdmap();
// uid's of lang 1 localized elements
$mappingArray = $dataHandler->copyMappingArray_merged;
// Localize again, with uid's of second language as source ("translation of translation")
$commandMap = [
'tt_content' => [
$mappingArray['tt_content'][self::VALUE_ContentIdFirst] => ['localize' => self::VALUE_LanguageIdSecond],
$mappingArray['tt_content'][self::VALUE_ContentIdSecond] => ['localize' => self::VALUE_LanguageIdSecond],
$mappingArray['tt_content'][self::VALUE_ContentIdThird] => ['localize' => self::VALUE_LanguageIdSecond],
],
];
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->start([], $commandMap);
$dataHandler->process_cmdmap();
}
public function createLocalizedContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newContentIdDefault = StringUtility::getUniqueId('NEW');
$newContentIdLocalized = StringUtility::getUniqueId('NEW');
$dataMap = [
self::TABLE_Content => [
$newContentIdDefault => ['pid' => self::VALUE_PageId, 'header' => 'Testing'],
$newContentIdLocalized => ['pid' => self::VALUE_PageId, 'header' => 'Localized Testing', 'sys_language_uid' => self::VALUE_LanguageId, 'l18n_parent' => $newContentIdDefault, 'l10n_source' => $newContentIdDefault],
],
];
$this->actionService->invoke($dataMap, []);
$this->recordIds['newContentIdDefault'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdDefault];
$this->recordIds['newContentIdLocalized'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdLocalized];
}
public function createLocalizedContentWithLanguageSynchronization(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
$newContentIdDefault = StringUtility::getUniqueId('NEW');
$newContentIdLocalized = StringUtility::getUniqueId('NEW');
$dataMap = [
self::TABLE_Content => [
$newContentIdDefault => ['pid' => self::VALUE_PageId, 'header' => 'Testing'],
$newContentIdLocalized => ['pid' => self::VALUE_PageId, 'header' => 'Localized Testing', 'sys_language_uid' => self::VALUE_LanguageId, 'l18n_parent' => $newContentIdDefault, 'l10n_source' => $newContentIdDefault],
],
];
$this->actionService->invoke($dataMap, []);
$this->recordIds['newContentIdDefault'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdDefault];
$this->recordIds['newContentIdLocalized'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdLocalized];
}
public function createLocalizedContentWithLocalizationExclude(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = 'exclude';
$newContentIdDefault = StringUtility::getUniqueId('NEW');
$newContentIdLocalized = StringUtility::getUniqueId('NEW');
$dataMap = [
self::TABLE_Content => [
$newContentIdDefault => ['pid' => self::VALUE_PageId, 'header' => 'Testing'],
$newContentIdLocalized => ['pid' => self::VALUE_PageId, 'header' => 'Localized Testing', 'sys_language_uid' => self::VALUE_LanguageId, 'l18n_parent' => $newContentIdDefault, 'l10n_source' => $newContentIdDefault],
],
];
$this->actionService->invoke($dataMap, []);
$this->recordIds['newContentIdDefault'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdDefault];
$this->recordIds['newContentIdLocalized'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newContentIdLocalized];
}
public function changeContentSorting(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
}
public function changeContentSortingAfterSelf(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdFirst);
}
public function moveContentToDifferentPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
}
public function hideContentAndMoveToDifferentPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['hidden' => '1']);
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
}
/**
* See DataSet/movePasteContentToDifferentPage.csv
*/
public function movePasteContentToDifferentPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget, ['header' => 'Testing #1']);
}
public function moveContentToDifferentPageAndChangeSorting(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
}
public function moveContentToDifferentPageAndHide(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget, ['hidden' => '1']);
}
public function moveLocalizedContentToDifferentPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageIdTarget, self::VALUE_LanguageId);
$this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdThird, self::VALUE_PageIdTarget);
}
/**
* Page records
*/
/**
* Create a page
*/
public function createPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1', 'hidden' => 0, 'nav_title' => 'Nav Testing #1']);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
}
public function createPageAndSubPageAndSubPageContent(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1', 'hidden' => 0]);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, $this->recordIds['newPageId'], ['title' => 'Testing #1 #1', 'hidden' => 0]);
$this->recordIds['newSubPageId'] = $newTableIds[self::TABLE_Page][0];
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, $this->recordIds['newSubPageId'], ['header' => 'Testing #1 #1', 'hidden' => 0]);
$this->recordIds['newSubPageContentId'] = $newTableIds[self::TABLE_Content][0];
}
/**
* This test creates a page on pid=88 (unlike other tests) and moves the new draft page on that exact level,
* in order to only modify the "sorting" and not the "pid" setting.
*/
public function createPageAndChangePageSorting(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, 88, ['title' => 'Testing #1', 'hidden' => 0, 'nav_title' => 'Nav Testing #1']);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
$this->actionService->moveRecord(self::TABLE_Page, $this->recordIds['newPageId'], -self::VALUE_PageId);
}
/**
* This change creates a page on pid=89 and moves the page one level up (= we check the pid value of both placeholder + versioned record).
*/
public function createPageAndMoveCreatedPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1', 'hidden' => 0, 'nav_title' => 'Nav Testing #1']);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
$this->actionService->moveRecord(self::TABLE_Page, $this->recordIds['newPageId'], -self::VALUE_PageId);
}
public function createPageAndContentWithTcaDefaults(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->createNewRecords(
self::VALUE_PageId,
[
self::TABLE_Page => ['title' => 'Testing #1'],
self::TABLE_Content => ['pid' => '__previousUid', 'header' => 'Testing #1'],
]
);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
$this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
}
public function modifyPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
}
public function deletePage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
}
public function copyPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
$this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
public function localizePage(): void
{
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizeAndCopyPage(): void
{
$newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
$this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageAndUpdateRecordWithMinorChangesInFullRetrievedRecord(): void
{
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->actionService->modifyRecord(self::TABLE_Page, $this->recordIds['localizedPageId'], ['title' => 'Testing #1']);
$record = $this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)
->select(['*'], self::TABLE_Page, ['uid' => $this->recordIds['localizedPageId']])
->fetchAssociative();
// cleanup some fields from record
unset($record['uid'], $record['pid'], $record['l10n_diffsource']);
$record['l10n_state'] = \json_decode($record['l10n_state']);
// modify record
$modifiedRecord = array_replace($record, ['title' => 'Testing #2']);
$this->actionService->modifyRecord(self::TABLE_Page, $this->recordIds['localizedPageId'], $modifiedRecord);
}
public function localizePageWithLanguageSynchronization(): void
{
unset($GLOBALS['TCA'][self::TABLE_Page]['columns']['title']['l10n_mode']);
$GLOBALS['TCA'][self::TABLE_Page]['columns']['title']['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
}
public function localizePageAndContentsAndDeletePageLocalization(): void
{
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
// Deleting the localized page should also delete its localized records
$this->actionService->deleteRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
}
public function localizeNestedPagesAndContents(): void
{
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageIdParent, self::VALUE_LanguageId);
$this->recordIds['localizedParentPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageIdParent];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdParent, self::VALUE_LanguageId);
$this->recordIds['localizedParentContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdParent];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
// Have another localized content element on page 88 to verify it's translation is also properly discarded in workspaces
$this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdParent, self::VALUE_PageIdParent);
}
public function localizePageNotHiddenHideAtCopyFalse(): void
{
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = false;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageHiddenHideAtCopyFalse(): void
{
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = false;
// @todo Add hidden page to importDefault.csv to make this database change superfluous.
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'hidden' => 1,
],
[
'uid' => self::VALUE_PageId,
]
);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageNotHiddenHideAtCopyDisableHideAtCopyUnset(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageHiddenHideAtCopyDisableHideAtCopyUnset(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
// @todo Add hidden page to importDefault.csv to make this database change superfluous.
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'hidden' => 1,
],
[
'uid' => self::VALUE_PageId,
]
);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageNotHiddenHideAtCopyDisableHideAtCopySetToFalse(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'TSconfig' => 'TCEMAIN.table.pages.disableHideAtCopy = 0',
],
[
'uid' => self::VALUE_PageIdWebsite,
]
);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageHiddenHideAtCopyDisableHideAtCopySetToFalse(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
// @todo Add hidden page to importDefault.csv to make this database change superfluous.
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'hidden' => 1,
],
[
'uid' => self::VALUE_PageId,
]
);
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'TSconfig' => 'TCEMAIN.table.pages.disableHideAtCopy = 0',
],
[
'uid' => self::VALUE_PageIdWebsite,
]
);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageNotHiddenHideAtCopyDisableHideAtCopySetToTrue(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'TSconfig' => 'TCEMAIN.table.pages.disableHideAtCopy = 1',
],
[
'uid' => self::VALUE_PageIdWebsite,
]
);
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageHiddenHideAtCopyDisableHideAtCopySetToTrue(): void
{
// This is the default, but set it to be expressive for this test.
$GLOBALS['TCA'][self::TABLE_Page]['ctrl']['hideAtCopy'] = true;
// @todo Add hidden page to importDefault.csv to make this database change superfluous.
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'hidden' => 1,
],
[
'uid' => self::VALUE_PageId,
]
);
$this->getConnectionPool()->getConnectionForTable(self::TABLE_Page)->update(
self::TABLE_Page,
[
'TSconfig' => 'TCEMAIN.table.pages.disableHideAtCopy = 1',
],
[
'uid' => self::VALUE_PageIdWebsite,
]
);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function changePageSorting(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
}
public function changePageSortingAfterSelf(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageId);
}
public function movePageToDifferentPage(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
}
public function movePageToDifferentPageTwice(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdWebsite);
}
/**
* Create page localization, then move default language page to different pages twice.
* Verifies the page localization is moved together with the default language page.
* In workspaces, the page localization will be a "new" overlay that is moved around.
*/
public function movePageLocalizedToDifferentPageTwice(): void
{
// Localize page first. In workspaces, this localization is created within ws, creating a "new" t3ver_state=1 record
$this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdWebsite);
}
/**
* Create page localization in live, then move default language page in workspaces to different pages twice.
* Verifies the page localization is moved together with the default language page.
* This should create "move" an overlay for the localization.
*
* No ext:core implementation of this test since it is identical with
* moveLocalizedPageToDifferentPageTwice() in non-workspace
*/
public function movePageLocalizedInLiveToDifferentPageTwice(): void
{
$this->setWorkspaceId(0);
$this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->setWorkspaceId(static::VALUE_WorkspaceId);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdWebsite);
}
/**
* Create page localization in live, then change the localization in workspace,
* then move default language page in workspaces to different pages twice.
* Verifies the page localization is moved together with the default language page, and that the
* "changed" t3ver_state=0 record is turned into a move placeholder when default language page is moved.
*
* No ext:core implementation of this test since it is identical with
* moveLocalizedPageToDifferentPageTwice() in non-workspace
*/
public function movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice(): void
{
$this->setWorkspaceId(0);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->setWorkspaceId(static::VALUE_WorkspaceId);
$this->actionService->modifyRecord(self::TABLE_Page, $this->recordIds['localizedPageId'], ['title' => 'Testing #1']);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdWebsite);
}
/**
* Create page localization in live, then delete the localization in workspace,
* then move default language page in workspaces to different pages twice.
* Verifies the page localization is moved together with the default language page.
*
* @todo The "deleted" t3ver_state=2 record is turned into a move placeholder so the "marked for delete" information is lost.
*
* No ext:core implementation of this test since it is identical with
* moveLocalizedPageToDifferentPageTwice() in non-workspace
*/
public function movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice(): void
{
$this->setWorkspaceId(0);
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->setWorkspaceId(static::VALUE_WorkspaceId);
$this->actionService->deleteRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdWebsite);
}
public function movePageToDifferentPageAndChangeSorting(): void
{
// Run test with translations
$this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefaultTranslations.csv');
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageIdTarget, self::VALUE_PageIdWebsite);
$this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
}
}