TYPO3 CMS  TYPO3_6-2
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
3 
17 require_once dirname(dirname(__FILE__)) . '/AbstractDataHandlerActionTestCase.php';
18 
23 
24  const VALUE_PageId = 89;
25  const VALUE_PageIdTarget = 90;
27  const VALUE_ContentIdFirst = 330;
28  const VALUE_ContentIdLast = 331;
29  const VALUE_FileIdFirst = 1;
30  const VALUE_FileIdLast = 21;
31  const VALUE_LanguageId = 1;
32 
37 
38  const TABLE_Page = 'pages';
39  const TABLE_Content = 'tt_content';
40  const TABLE_File = 'sys_file';
41  const TABLE_FileMetadata = 'sys_file_metadata';
42  const TABLE_FileReference = 'sys_file_reference';
43 
44  const FIELD_ContentImage = 'image';
45  const FIELD_FileReferenceImage = 'uid_local';
46 
50  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/FAL/DataSet/';
51 
52  public function setUp() {
53  parent::setUp();
54  $this->importScenarioDataSet('LiveDefaultPages');
55  $this->importScenarioDataSet('LiveDefaultElements');
56  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/sys_file_storage.xml');
57 
58  $this->setUpFrontendRootPage(1, array('typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts'));
59  $this->backendUser->workspace = 0;
60  }
61 
69  public function modifyContent() {
70  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, array('header' => 'Testing #1'));
71  }
72 
76  public function deleteContent() {
77  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
78  }
79 
83  public function copyContent() {
84  $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
85  $this->recordIds['copiedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
86  }
87 
91  public function localizeContent() {
92  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
93  $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
94  }
95 
99  public function changeContentSorting() {
100  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
101  }
102 
106  public function moveContentToDifferentPage() {
107  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
108  }
109 
114  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
115  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
116  }
117 
122  public function createContentWithFileReference() {
123  $newTableIds = $this->actionService->createNewRecords(
124  self::VALUE_PageId,
125  array(
126  self::TABLE_Content => array('header' => 'Testing #1', self::FIELD_ContentImage => '__nextUid'),
127  self::TABLE_FileReference => array('title' => 'Image #1', self::FIELD_FileReferenceImage => self::VALUE_FileIdFirst),
128  )
129  );
130  $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
131  }
132 
133  public function modifyContentWithFileReference() {
134  $this->actionService->modifyRecords(
135  self::VALUE_PageId,
136  array(
137  self::TABLE_Content => array('uid' => self::VALUE_ContentIdLast, 'header' => 'Testing #1', self::FIELD_ContentImage => self::VALUE_FileReferenceContentLastFileLast . ',' . self::VALUE_FileReferenceContentLastFileFirst),
138  self::TABLE_FileReference => array('uid' => self::VALUE_FileReferenceContentLastFileFirst, 'title' => 'Image #1'),
139  )
140  );
141  }
142 
144  $this->actionService->modifyRecords(
145  self::VALUE_PageId,
146  array(
147  self::TABLE_Content => array('uid' => self::VALUE_ContentIdLast, self::FIELD_ContentImage => self::VALUE_FileReferenceContentLastFileLast . ',' . self::VALUE_FileReferenceContentLastFileFirst . ',__nextUid'),
148  self::TABLE_FileReference => array('uid' => '__NEW', 'title' => 'Image #3', self::FIELD_FileReferenceImage => self::VALUE_FileIdFirst),
149  )
150  );
151  }
152 
154  $this->actionService->modifyRecord(
155  self::TABLE_Content,
156  self::VALUE_ContentIdLast,
157  array(self::FIELD_ContentImage => self::VALUE_FileReferenceContentLastFileFirst),
158  array(self::TABLE_FileReference => array(self::VALUE_FileReferenceContentLastFileLast))
159  );
160  }
161 
163  $this->actionService->modifyRecord(
164  self::TABLE_Content,
165  self::VALUE_ContentIdLast,
166  array(self::FIELD_ContentImage => ''),
167  array(self::TABLE_FileReference => array(self::VALUE_FileReferenceContentLastFileFirst, self::VALUE_FileReferenceContentLastFileLast))
168  );
169  }
170 
171 }
setUpFrontendRootPage($pageId, array $typoScriptFiles=array())