[BUGFIX] mssql: Proper types inserting / updating rows
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / DataHandling / IRRE / ForeignField / AbstractActionTestCase.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Functional test for the DataHandler
19 */
20 abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
21 {
22 const VALUE_PageId = 89;
23 const VALUE_PageIdTarget = 90;
24 const VALUE_PageIdWebsite = 1;
25 const VALUE_ContentIdFirst = 297;
26 const VALUE_ContentIdLast = 298;
27 const VALUE_HotelIdFirst = 3;
28 const VALUE_HotelIdSecond = 4;
29 const VALUE_HotelIdThird = 5;
30 const VALUE_LanguageId = 1;
31 const VALUE_LanguageIdSecond = 2;
32
33 const TABLE_Page = 'pages';
34 const TABLE_PageOverlay = 'pages_language_overlay';
35 const TABLE_Content = 'tt_content';
36 const TABLE_Hotel = 'tx_irretutorial_1nff_hotel';
37 const TABLE_Offer = 'tx_irretutorial_1nff_offer';
38
39 const FIELD_PageHotel = 'tx_irretutorial_hotels';
40 const FIELD_ContentHotel = 'tx_irretutorial_1nff_hotels';
41 const FIELD_HotelOffer = 'offers';
42
43 /**
44 * @var string
45 */
46 protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/DataSet/';
47
48 protected function setUp()
49 {
50 parent::setUp();
51 $this->importScenarioDataSet('LiveDefaultPages');
52 $this->importScenarioDataSet('LiveDefaultElements');
53
54 $this->setUpFrontendRootPage(
55 1,
56 [
57 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
58 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.ts',
59 ]
60 );
61 $this->backendUser->workspace = 0;
62 }
63
64 /**
65 * Parent content records
66 */
67
68 /**
69 * @see DataSet/createParentContentRecord.csv
70 */
71 public function createParentContent()
72 {
73 $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']);
74 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
75 }
76
77 /**
78 * @see DataSet/modifyParentContentRecord.csv
79 */
80 public function modifyParentContent()
81 {
82 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, ['header' => 'Testing #1']);
83 }
84
85 /**
86 * @see DataSet/deleteParentContentRecord.csv
87 */
88 public function deleteParentContent()
89 {
90 $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
91 }
92
93 /**
94 * @see DataSet/copyParentContentRecord.csv
95 */
96 public function copyParentContent()
97 {
98 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
99 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
100 }
101
102 /**
103 * @see DataSet/copyParentContentToDifferentPage.csv
104 */
105 public function copyParentContentToDifferentPage()
106 {
107 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
108 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
109 }
110
111 /**
112 * @see DataSet/copyParentContentToLanguageKeep.csv
113 */
114 public function copyParentContentToLanguageInKeepMode()
115 {
116 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
117 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
118 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
119 $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
120 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
121 }
122
123 /**
124 * @see DataSet/copyParentContentToLanguageWAllChildrenKeep.csv
125 */
126 public function copyParentContentToLanguageWithAllChildrenInKeepMode()
127 {
128 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
129 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
130 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
131 $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
132 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
133 }
134
135 /**
136 * @see DataSet/copyParentContentToLanguageSelect.csv
137 */
138 public function copyParentContentToLanguageInSelectMode()
139 {
140 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
141 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
142 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
143 $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
144 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
145 }
146
147 /**
148 * @see DataSet/copyParentContentToLanguageWAllChildrenSelect.csv
149 */
150 public function copyParentContentToLanguageWithAllChildrenInSelectMode()
151 {
152 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
153 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
154 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
155 $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
156 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
157 }
158
159 /**
160 * @see DataSet/localizeParentContentKeep.csv
161 */
162 public function localizeParentContentInKeepMode()
163 {
164 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
165 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
166 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
167 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
168 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
169 }
170
171 /**
172 * @see DataSet/localizeParentContentWAllChildrenKeep.csv
173 */
174 public function localizeParentContentWithAllChildrenInKeepMode()
175 {
176 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
177 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
178 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
179 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
180 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
181 }
182
183 /**
184 * @see DataSet/localizeParentContentSelect.csv
185 */
186 public function localizeParentContentInSelectMode()
187 {
188 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
189 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
190 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
191 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
192 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
193 }
194
195 /**
196 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
197 */
198 public function localizeParentContentWithAllChildrenInSelectMode()
199 {
200 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
201 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
202 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
203 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
204 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
205 }
206
207 /**
208 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
209 */
210 public function localizeParentContentWithAllChildrenInSelectModeAndLanguageSynchronization()
211 {
212 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
213 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
214 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
215 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
216 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
217 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
218 $this->actionService->modifyRecords(
219 self::VALUE_PageId,
220 [
221 self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
222 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
223 ]
224 );
225 }
226
227 /**
228 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
229 */
230 public function localizeParentContentChainWithAllChildrenInSelectModeAndLanguageSynchronizationSource()
231 {
232 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
233 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
234 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
235 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
236 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
237 $this->recordIds['localizedContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
238 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['localizedContentIdFirst'], self::VALUE_LanguageIdSecond);
239 $this->recordIds['localizedContentIdSecond'] = $newTableIds[self::TABLE_Content][$this->recordIds['localizedContentIdFirst']];
240 $this->actionService->modifyRecord(
241 self::TABLE_Content,
242 $this->recordIds['localizedContentIdSecond'],
243 ['l10n_state' => [self::FIELD_ContentHotel => 'source']]
244 );
245 $this->actionService->modifyRecords(
246 self::VALUE_PageId,
247 [
248 self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
249 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
250 ]
251 );
252 }
253
254 /**
255 * @see DataSet/changeParentContentRecordSorting.csv
256 */
257 public function changeParentContentSorting()
258 {
259 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
260 }
261
262 /**
263 * @see DataSet/moveParentContentRecordToDifferentPage.csv
264 */
265 public function moveParentContentToDifferentPage()
266 {
267 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
268 }
269
270 /**
271 * @see DataSet/moveParentContentRecordToDifferentPageAndChangeSorting.csv
272 */
273 public function moveParentContentToDifferentPageAndChangeSorting()
274 {
275 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
276 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
277 }
278
279 /**
280 * Page records
281 */
282
283 /**
284 * @see DataSet/modifyPageRecord.csv
285 */
286 public function modifyPage()
287 {
288 $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
289 }
290
291 /**
292 * @see DataSet/deletePageRecord.csv
293 */
294 public function deletePage()
295 {
296 $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
297 }
298
299 /**
300 * @see DataSet/copyPageRecord.csv
301 */
302 public function copyPage()
303 {
304 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
305 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
306 $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
307 $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
308 }
309
310 /**
311 * @see DataSet/copyPageWHotelBeforeParentContent.csv
312 */
313 public function copyPageWithHotelBeforeParentContent()
314 {
315 // Ensure hotels get processed first
316 $GLOBALS['TCA'] = array_merge(
317 [self::TABLE_Hotel => $GLOBALS['TCA'][self::TABLE_Hotel]],
318 $GLOBALS['TCA']
319 );
320
321 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
322 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
323 $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
324 $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
325 }
326
327 /**
328 * IRRE Child Records
329 */
330
331 /**
332 * @see DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv
333 */
334 public function createParentContentWithHotelAndOfferChildren()
335 {
336 $newTableIds = $this->actionService->createNewRecords(
337 self::VALUE_PageId,
338 [
339 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
340 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
341 self::TABLE_Offer => ['title' => 'Offer #1'],
342 ]
343 );
344 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
345 }
346
347 /**
348 * @see DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecords.csv
349 */
350 public function createAndCopyParentContentWithHotelAndOfferChildren()
351 {
352 $newTableIds = $this->actionService->createNewRecords(
353 self::VALUE_PageId,
354 [
355 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
356 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
357 self::TABLE_Offer => ['title' => 'Offer #1'],
358 ]
359 );
360 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
361 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
362 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_PageId);
363 $this->recordIds['copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
364 $this->recordIds['copiedHotelId'] = $copiedTableIds[self::TABLE_Hotel][$this->recordIds['newHotelId']];
365 }
366
367 /**
368 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
369 */
370 public function createAndLocalizeParentContentWithHotelAndOfferChildren()
371 {
372 $newTableIds = $this->actionService->createNewRecords(
373 self::VALUE_PageId,
374 [
375 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
376 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
377 self::TABLE_Offer => ['title' => 'Offer #1'],
378 ]
379 );
380 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
381 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
382 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
383 $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
384 }
385
386 /**
387 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
388 */
389 public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
390 {
391 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['sortby']);
392 $newTableIds = $this->actionService->createNewRecords(
393 self::VALUE_PageId,
394 [
395 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
396 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
397 self::TABLE_Offer => ['title' => 'Offer #1'],
398 ]
399 );
400 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
401 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
402 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
403 $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
404 }
405
406 /**
407 * @see DataSet/modifyOnlyHotelChildRecord.csv
408 */
409 public function modifyOnlyHotelChild()
410 {
411 $this->actionService->modifyRecord(self::TABLE_Hotel, 4, ['title' => 'Testing #1']);
412 }
413
414 /**
415 * @see DataSet/modifyParentRecordAndChangeHotelChildRecordsSorting.csv
416 */
417 public function modifyParentAndChangeHotelChildrenSorting()
418 {
419 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, [self::FIELD_ContentHotel => '4,3']);
420 }
421
422 /**
423 * @see DataSet/modifyParentRecordWithHotelChildRecord.csv
424 */
425 public function modifyParentWithHotelChild()
426 {
427 $this->actionService->modifyRecords(
428 self::VALUE_PageId,
429 [
430 self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel => '3,4'],
431 self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
432 ]
433 );
434 }
435
436 /**
437 * @see DataSet/modifyParentRecordAndAddHotelChildRecord.csv
438 */
439 public function modifyParentAndAddHotelChild()
440 {
441 $this->actionService->modifyRecords(
442 self::VALUE_PageId,
443 [
444 self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
445 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
446 ]
447 );
448 }
449
450 /**
451 * @see DataSet/modifyParentRecordAndDeleteHotelChildRecord.csv
452 */
453 public function modifyParentAndDeleteHotelChild()
454 {
455 $this->actionService->modifyRecord(
456 self::TABLE_Content,
457 self::VALUE_ContentIdFirst,
458 [self::FIELD_ContentHotel => '3'],
459 [self::TABLE_Hotel => [4]]
460 );
461 }
462
463 public function localizePageWithLocalizationExclude()
464 {
465 $GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
466 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
467 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
468 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
469 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
470 }
471
472 public function localizePageAndAddHotelChildWithLocalizationExclude()
473 {
474 $GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
475 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
476 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
477 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
478 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
479 $this->actionService->modifyRecords(
480 self::VALUE_PageId,
481 [
482 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
483 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
484 ]
485 );
486 }
487
488 public function localizePageWithLanguageSynchronization()
489 {
490 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
491 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
492 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
493 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
494 }
495
496 public function localizePageAndAddHotelChildWithLanguageSynchronization()
497 {
498 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
499 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
500 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
501 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
502 $this->actionService->modifyRecords(
503 self::VALUE_PageId,
504 [
505 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
506 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
507 ]
508 );
509 }
510
511 public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
512 {
513 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['languageField']);
514 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['transOrigPointerField']);
515 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
516 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
517 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
518 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
519 $this->actionService->modifyRecords(
520 self::VALUE_PageId,
521 [
522 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
523 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
524 ]
525 );
526 }
527
528 public function localizeAndCopyPageWithLanguageSynchronization()
529 {
530 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
531 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
532 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
533 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
534 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
535 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
536 }
537 }