2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField;
20 abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
58 $this->importScenarioDataSet(
'LiveDefaultPages');
59 $this->importScenarioDataSet(
'LiveDefaultElements');
60 $this->importScenarioDataSet(
'ReferenceIndex');
62 $this->setUpFrontendRootPage(
65 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
66 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.ts',
69 $this->backendUser->workspace = self::VALUE_WorkspaceId;
81 $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, array(
'header' =>
'Testing #1'));
82 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
90 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, array(
'header' =>
'Testing #1'));
98 $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
106 $newTableIds = $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
107 $versionedDeletedContentId = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
108 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedDeletedContentId);
116 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
117 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
125 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
126 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
134 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'keep';
135 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
136 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
137 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
138 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
146 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'keep';
147 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
148 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
149 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
150 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
158 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'select';
159 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
160 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
161 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
162 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
170 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'select';
171 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
172 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
173 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
174 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
182 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
190 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
198 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
199 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
211 $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, array(
'title' =>
'Testing #1'));
219 $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
227 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
228 $this->recordIds[
'newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
229 $this->recordIds[
'newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
230 $this->recordIds[
'newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
241 array(self::TABLE_Hotel =>
$GLOBALS[
'TCA'][self::TABLE_Hotel]),
245 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
246 $this->recordIds[
'newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
247 $this->recordIds[
'newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
248 $this->recordIds[
'newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
260 $newTableIds = $this->actionService->createNewRecords(
263 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
264 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
265 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
268 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
276 $newTableIds = $this->actionService->createNewRecords(
279 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
280 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
281 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
284 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
285 $this->recordIds[
'newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
286 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_PageId);
287 $this->recordIds[
'copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
288 $this->recordIds[
'copiedHotelId'] = $copiedTableIds[self::TABLE_Hotel][$this->recordIds[
'newHotelId']];
296 $newTableIds = $this->actionService->createNewRecords(
299 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
300 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
301 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
304 $this->recordIds[
'newContentId'] = $newTableIds[
'tt_content'][0];
305 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_PageId);
306 $this->recordIds[
'copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
307 $versionedCopiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'copiedContentId']);
308 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedCopiedContentId);
316 $newTableIds = $this->actionService->createNewRecords(
319 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
320 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
321 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
324 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
325 $this->recordIds[
'newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
326 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
327 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
335 unset(
$GLOBALS[
'TCA'][self::TABLE_Hotel][
'ctrl'][
'sortby']);
336 $newTableIds = $this->actionService->createNewRecords(
339 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
340 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
341 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
344 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
345 $this->recordIds[
'newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
346 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
347 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
355 $newTableIds = $this->actionService->createNewRecords(
358 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
359 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
360 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
363 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
364 $this->recordIds[
'versionedNewContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'newContentId']);
365 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
366 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
367 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds[
'versionedNewContentId']);
375 $newTableIds = $this->actionService->createNewRecords(
378 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
379 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
380 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
383 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
384 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
385 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
386 $versionedLocalizedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'localizedContentId']);
387 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedLocalizedContentId);
395 $this->actionService->modifyRecord(self::TABLE_Hotel, 4, array(
'title' =>
'Testing #1'));
403 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, array(self::FIELD_ContentHotel =>
'4,3'));
411 $this->actionService->modifyRecords(
414 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
415 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
425 $this->actionService->modifyRecords(
428 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
429 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
432 $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
433 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $modifiedContentId);
441 $this->actionService->modifyRecords(
444 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
445 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
448 $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
449 $modifiedHotelId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
450 $this->actionService->clearWorkspaceRecords(
452 self::TABLE_Content => array($modifiedContentId),
453 self::TABLE_Hotel => array($modifiedHotelId),
463 $this->actionService->modifyRecords(
466 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel =>
'5,__nextUid'),
467 self::TABLE_Hotel => array(
'uid' =>
'__NEW',
'title' =>
'Hotel #2'),
477 $this->actionService->modifyRecord(
479 self::VALUE_ContentIdFirst,
480 array(self::FIELD_ContentHotel =>
'3'),
481 array(self::TABLE_Hotel => array(4))
490 $this->actionService->modifyRecords(
493 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst,
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'3,4'),
494 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
497 $this->recordIds[
'versionedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
498 $this->recordIds[
'versionedHotelIdFirst'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 3);
499 $this->recordIds[
'versionedHotelIdSecond'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
500 $this->actionService->clearWorkspaceRecords(
502 self::TABLE_Content => array($this->recordIds[
'versionedContentId']),
503 self::TABLE_Hotel => array($this->recordIds[
'versionedHotelIdSecond']),
506 $this->actionService->modifyRecords(
509 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst,
'header' =>
'Testing #2', self::FIELD_ContentHotel =>
'3,4'),
510 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #2'),