2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV;
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(1, array(
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts'));
63 $this->backendUser->workspace = self::VALUE_WorkspaceId;
75 $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, array(
'header' =>
'Testing #1'));
76 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
84 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, array(
'header' =>
'Testing #1'));
92 $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
100 $newTableIds = $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
101 $versionedDeletedContentId = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
102 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedDeletedContentId);
110 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
111 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
119 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
120 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
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'] =
false;
130 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
131 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
132 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
140 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'keep';
141 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
142 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
143 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
144 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
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'] =
false;
154 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
false;
155 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
156 $this->recordIds[
'localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
164 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizationMode'] =
'select';
165 $GLOBALS[
'TCA'][self::TABLE_Content][
'columns'][self::FIELD_ContentHotel][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
166 $GLOBALS[
'TCA'][self::TABLE_Hotel][
'columns'][self::FIELD_HotelOffer][
'config'][
'behaviour'][
'localizeChildrenAtParentLocalization'] =
true;
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];
176 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
184 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
192 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
193 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
205 $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, array(
'title' =>
'Testing #1'));
213 $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
221 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
222 $this->recordIds[
'newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
223 $this->recordIds[
'newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
224 $this->recordIds[
'newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
235 array(self::TABLE_Hotel =>
$GLOBALS[
'TCA'][self::TABLE_Hotel]),
239 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
240 $this->recordIds[
'newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
241 $this->recordIds[
'newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
242 $this->recordIds[
'newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
254 $newTableIds = $this->actionService->createNewRecords(
257 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
258 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
259 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
262 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
271 $newTableIds = $this->actionService->createNewRecords(
274 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
275 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
276 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
279 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
280 $this->recordIds[
'newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
281 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_PageId);
282 $this->recordIds[
'copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
283 $this->recordIds[
'copiedHotelId'] = $copiedTableIds[self::TABLE_Hotel][$this->recordIds[
'newHotelId']];
292 $newTableIds = $this->actionService->createNewRecords(
295 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
296 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
297 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
300 $this->recordIds[
'newContentId'] = $newTableIds[
'tt_content'][0];
301 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_PageId);
302 $this->recordIds[
'copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
303 $versionedCopiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'copiedContentId']);
304 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedCopiedContentId);
313 $newTableIds = $this->actionService->createNewRecords(
316 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
317 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
318 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
321 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
322 $this->recordIds[
'newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
323 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
324 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
325 $this->recordIds[
'localizedHotelId'] = $localizedTableIds[self::TABLE_Hotel][$this->recordIds[
'newHotelId']];
333 $newTableIds = $this->actionService->createNewRecords(
336 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
337 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
338 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
341 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
342 $this->recordIds[
'versionedNewContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'newContentId']);
343 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
344 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
345 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds[
'versionedNewContentId']);
354 $newTableIds = $this->actionService->createNewRecords(
357 self::TABLE_Content => array(
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'__nextUid'),
358 self::TABLE_Hotel => array(
'title' =>
'Hotel #1', self::FIELD_HotelOffer =>
'__nextUid'),
359 self::TABLE_Offer => array(
'title' =>
'Offer #1'),
362 $this->recordIds[
'newContentId'] = $newTableIds[self::TABLE_Content][0];
363 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds[
'newContentId'], self::VALUE_LanguageId);
364 $this->recordIds[
'localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds[
'newContentId']];
365 $versionedLocalizedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds[
'localizedContentId']);
366 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedLocalizedContentId);
374 $this->actionService->modifyRecord(self::TABLE_Hotel, 4, array(
'title' =>
'Testing #1'));
382 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, array(self::FIELD_ContentHotel =>
'4,3'));
390 $this->actionService->modifyRecords(
393 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
394 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
404 $this->actionService->modifyRecords(
407 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
408 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
411 $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
412 $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $modifiedContentId);
420 $this->actionService->modifyRecords(
423 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel =>
'3,4'),
424 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
427 $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
428 $modifiedHotelId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
429 $this->actionService->clearWorkspaceRecords(
431 self::TABLE_Content => array($modifiedContentId),
432 self::TABLE_Hotel => array($modifiedHotelId),
442 $this->actionService->modifyRecords(
445 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel =>
'5,__nextUid'),
446 self::TABLE_Hotel => array(
'uid' =>
'__NEW',
'title' =>
'Hotel #2'),
456 $this->actionService->modifyRecord(
458 self::VALUE_ContentIdFirst,
459 array(self::FIELD_ContentHotel =>
'3'),
460 array(self::TABLE_Hotel => array(4))
469 $this->actionService->modifyRecords(
472 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst,
'header' =>
'Testing #1', self::FIELD_ContentHotel =>
'3,4'),
473 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #1'),
476 $this->recordIds[
'versionedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
477 $this->recordIds[
'versionedHotelIdFirst'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 3);
478 $this->recordIds[
'versionedHotelIdSecond'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
479 $this->actionService->clearWorkspaceRecords(
481 self::TABLE_Content => array($this->recordIds[
'versionedContentId']),
482 self::TABLE_Hotel => array($this->recordIds[
'versionedHotelIdSecond']),
485 $this->actionService->modifyRecords(
488 self::TABLE_Content => array(
'uid' => self::VALUE_ContentIdFirst,
'header' =>
'Testing #2', self::FIELD_ContentHotel =>
'3,4'),
489 self::TABLE_Hotel => array(
'uid' => 4,
'title' =>
'Testing #2'),