TYPO3 CMS  TYPO3_7-6
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
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;
24  const VALUE_ContentIdFirst = 297;
25  const VALUE_ContentIdLast = 298;
26  const VALUE_LanguageId = 1;
29 
30  const TABLE_Page = 'pages';
31  const TABLE_Content = 'tt_content';
32  const TABLE_Category = 'sys_category';
33  const TABLE_ContentCategory_ManyToMany = 'sys_category_record_mm';
34 
38  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/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 addCategoryRelation()
59  {
60  $this->actionService->modifyReferences(
61  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', [self::VALUE_CategoryIdFirst, self::VALUE_CategoryIdSecond, 31]
62  );
63  }
64 
69  public function deleteCategoryRelation()
70  {
71  $this->actionService->modifyReferences(
72  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', [self::VALUE_CategoryIdFirst]
73  );
74  }
75 
81  {
82  $this->actionService->modifyReferences(
83  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', [self::VALUE_CategoryIdSecond, self::VALUE_CategoryIdFirst]
84  );
85  }
86 
91  public function modifyCategoryOfRelation()
92  {
93  $this->actionService->modifyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, ['title' => 'Testing #1']);
94  }
95 
100  public function modifyContentOfRelation()
101  {
102  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, ['header' => 'Testing #1']);
103  }
104 
109  public function modifyBothsOfRelation()
110  {
111  $this->actionService->modifyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, ['title' => 'Testing #1']);
112  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, ['header' => 'Testing #1']);
113  }
114 
119  public function deleteContentOfRelation()
120  {
121  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
122  }
123 
128  public function deleteCategoryOfRelation()
129  {
130  $this->actionService->deleteRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst);
131  }
132 
137  public function copyContentOfRelation()
138  {
139  $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
140  $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
141  }
142 
147  public function copyCategoryOfRelation()
148  {
149  $this->actionService->copyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, 0);
150  }
151 
157  {
158  $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
159  }
160 
166  {
167  $this->actionService->copyRecordToLanguage(self::TABLE_Category, self::VALUE_CategoryIdFirst, self::VALUE_LanguageId);
168  }
169 
174  public function localizeContentOfRelation()
175  {
176  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
177  }
178 
183  public function localizeCategoryOfRelation()
184  {
185  $this->actionService->localizeRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, self::VALUE_LanguageId);
186  }
187 
193  {
194  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
195  }
196 
201  public function copyPage()
202  {
203  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
204  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
205  $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
206  $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
207  }
208 }
setUpFrontendRootPage($pageId, array $typoScriptFiles=[])