TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular;
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 
21 {
22  const VALUE_PageId = 89;
23  const VALUE_PageIdTarget = 90;
25  const VALUE_ContentIdFirst = 297;
26  const VALUE_ContentIdSecond = 298;
27  const VALUE_ContentIdThird = 299;
29  const VALUE_LanguageId = 1;
31 
32  const TABLE_Page = 'pages';
33  const TABLE_Content = 'tt_content';
34 
38  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
39 
40  protected function setUp()
41  {
42  parent::setUp();
43  $this->importScenarioDataSet('LiveDefaultPages');
44  $this->importScenarioDataSet('LiveDefaultElements');
45 
46  $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts']);
47  $this->backendUser->workspace = 0;
48  }
49 
58  public function createContents()
59  {
60  // Creating record at the beginning of the page
61  $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']);
62  // Creating record at the end of the page (after last one)
63  $this->actionService->createNewRecord(self::TABLE_Content, -self::VALUE_ContentIdSecond, ['header' => 'Testing #2']);
64  }
65 
70  public function modifyContent()
71  {
72  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, ['header' => 'Testing #1']);
73  }
74 
79  public function deleteContent()
80  {
81  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
82  }
83 
88  {
89  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized);
90  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdThird);
91  }
92 
97  public function copyContent()
98  {
99  $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId);
100  }
101 
106  public function copyPasteContent()
107  {
108  $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageId, ['header' => 'Testing #1']);
109  }
110 
115  public function localizeContent()
116  {
117  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
118  }
119 
125  {
126  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, self::VALUE_LanguageIdSecond);
127  }
128 
133  public function changeContentSorting()
134  {
135  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
136  }
137 
142  public function moveContentToDifferentPage()
143  {
144  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
145  }
146 
152  {
153  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget, ['header' => 'Testing #1']);
154  }
155 
161  {
162  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_PageIdTarget);
163  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond);
164  }
165 
174  public function createPage()
175  {
176  $newTableIds = $this->actionService->createNewRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1', 'hidden' => 0]);
177  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][0];
178  }
179 
184  public function modifyPage()
185  {
186  $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
187  }
188 
193  public function deletePage()
194  {
195  $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
196  }
197 
202  public function copyPage()
203  {
204  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
205  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
206  }
207 
212  public function localizePage()
213  {
214  $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
215  }
216 
221  public function changePageSorting()
222  {
223  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
224  }
225 
230  public function movePageToDifferentPage()
231  {
232  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
233  }
234 
240  {
241  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageIdTarget, self::VALUE_PageIdWebsite);
242  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageId, -self::VALUE_PageIdTarget);
243  }
244 }
setUpFrontendRootPage($pageId, array $typoScriptFiles=[])