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 = 297;
28  const VALUE_ContentIdSecond = 298;
29  const VALUE_ContentIdThird = 299;
31  const VALUE_LanguageId = 1;
32 
33  const TABLE_Page = 'pages';
34  const TABLE_Content = 'tt_content';
35 
39  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
40 
41  public function setUp() {
42  parent::setUp();
43  $this->importScenarioDataSet('LiveDefaultPages');
44  $this->importScenarioDataSet('LiveDefaultElements');
45 
46  $this->setUpFrontendRootPage(1, array('typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts'));
47  $this->backendUser->workspace = 0;
48  }
49 
58  public function createContents() {
59  // Creating record at the beginning of the page
60  $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, array('header' => 'Testing #1'));
61  // Creating record at the end of the page (after last one)
62  $this->actionService->createNewRecord(self::TABLE_Content, -self::VALUE_ContentIdSecond, array('header' => 'Testing #2'));
63  }
64 
69  public function modifyContent() {
70  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, array('header' => 'Testing #1'));
71  }
72 
77  public function deleteContent() {
78  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
79  }
80 
85  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized);
86  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThird);
87  }
88 
93  public function copyContent() {
94  $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId);
95  }
96 
101  public function copyPasteContent() {
102  $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId, array('header' => 'Testing #1'));
103  }
104 
109  public function localizeContent() {
110  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
111  }
112 
117  public function changeContentSorting() {
118  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
119  }
120 
125  public function moveContentToDifferentPage() {
126  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
127  }
128 
134  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget, array('header' => 'Testing #1'));
135  }
136 
142  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
143  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
144  }
145 
154  public function createPage() {
155  $newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, self::VALUE_PageId, array('title' => 'Testing #1', 'hidden' => 0));
156  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
157  }
158 
163  public function modifyPage() {
164  $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, array('title' => 'Testing #1'));
165  }
166 
171  public function deletePage() {
172  $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
173  }
174 
179  public function copyPage() {
180  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
181  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
182  }
183 
188  public function localizePage() {
189  $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
190  }
191 
196  public function changePageSorting() {
197  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
198  }
199 
204  public function movePageToDifferentPage() {
205  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
206  }
207 
213  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageIdTarget, self::VALUE_PageIdWebsite);
214  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
215  }
216 
217 }
setUpFrontendRootPage($pageId, array $typoScriptFiles=array())