[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Tests / Functional / DataHandling / ManyToMany / PublishAll / ActionTest.php
1 <?php
2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\PublishAll;
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
17 require_once dirname(dirname(__FILE__)) . '/AbstractActionTestCase.php';
18
19 /**
20 * Functional test for the DataHandler
21 */
22 class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase {
23
24 /**
25 * @var string
26 */
27 protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/';
28
29 /**
30 * MM Relations
31 */
32
33 /**
34 * @test
35 * @see DataSet/Assertion/addCategoryRelation.csv
36 */
37 public function addCategoryRelation() {
38 parent::addCategoryRelation();
39 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
40 $this->assertAssertionDataSet('addCategoryRelation');
41
42 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
43 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
44 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
45 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B', 'Category A.A'));
46 }
47
48 /**
49 * @test
50 * @see DataSet/Assertion/deleteCategoryRelation.csv
51 */
52 public function deleteCategoryRelation() {
53 parent::deleteCategoryRelation();
54 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
55 $this->assertAssertionDataSet('deleteCategoryRelation');
56
57 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
58 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
59 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
60 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
61 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
62 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
63 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C', 'Category A.A'));
64 }
65
66 /**
67 * @test
68 * @see DataSet/Assertion/changeCategoryRelationSorting.csv
69 */
70 public function changeCategoryRelationSorting() {
71 parent::changeCategoryRelationSorting();
72 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
73 $this->assertAssertionDataSet('changeCategoryRelationSorting');
74
75 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
76 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
77 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
78 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
79 }
80
81 /**
82 * @test
83 * @see DataSet/Assertion/createContentRecordAndAddCategoryRelation.csv
84 */
85 public function createContentAndAddRelation() {
86 parent::createContentAndAddRelation();
87 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
88 $this->assertAssertionDataSet('createContentNAddRelation');
89
90 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
91 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
92 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
93 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
94 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
95 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B'));
96 }
97
98 /**
99 * @test
100 * @see DataSet/Assertion/createCategoryRecordAndAddCategoryRelation.csv
101 */
102 public function createCategoryAndAddRelation() {
103 parent::createCategoryAndAddRelation();
104 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
105 $this->assertAssertionDataSet('createCategoryNAddRelation');
106
107 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
108 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
109 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
110 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
111 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
112 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
113 }
114
115 /**
116 * @test
117 * @see DataSet/Assertion/createContentRecordAndCreateCategoryRelation.csv
118 */
119 public function createContentAndCreateRelation() {
120 parent::createContentAndCreateRelation();
121 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
122 $this->assertAssertionDataSet('createContentNCreateRelation');
123
124 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
125 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
126 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
127 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
128 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
129 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
130 }
131
132 /**
133 * @test
134 * @see DataSet/Assertion/createCategoryRecordAndCreateCategoryRelation.csv
135 */
136 public function createCategoryAndCreateRelation() {
137 parent::createCategoryAndCreateRelation();
138 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
139 $this->assertAssertionDataSet('createCategoryNCreateRelation');
140 }
141
142 /**
143 * @test
144 * @see DataSet/Assertion/modifyCategoryRecordOfCategoryRelation.csv
145 */
146 public function modifyCategoryOfRelation() {
147 parent::modifyCategoryOfRelation();
148 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
149 $this->assertAssertionDataSet('modifyCategoryOfRelation');
150
151 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
152 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
153 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
154 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
155 }
156
157 /**
158 * @test
159 * @see DataSet/Assertion/modifyContentRecordOfCategoryRelation.csv
160 */
161 public function modifyContentOfRelation() {
162 parent::modifyContentOfRelation();
163 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
164 $this->assertAssertionDataSet('modifyContentOfRelation');
165
166 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
167 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
168 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
169 }
170
171 /**
172 * @test
173 * @see DataSet/Assertion/modifyBothRecordsOfCategoryRelation.csv
174 */
175 public function modifyBothsOfRelation() {
176 parent::modifyBothsOfRelation();
177 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
178 $this->assertAssertionDataSet('modifyBothsOfRelation');
179
180 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
181 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
182 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
183 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
184 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
185 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
186 }
187
188 /**
189 * @test
190 * @see DataSet/Assertion/deleteContentRecordOfCategoryRelation.csv
191 */
192 public function deleteContentOfRelation() {
193 parent::deleteContentOfRelation();
194 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
195 $this->assertAssertionDataSet('deleteContentOfRelation');
196
197 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
198 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
199 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
200 }
201
202 /**
203 * @test
204 * @see DataSet/Assertion/deleteCategoryRecordOfCategoryRelation.csv
205 */
206 public function deleteCategoryOfRelation() {
207 parent::deleteCategoryOfRelation();
208 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
209 $this->assertAssertionDataSet('deleteCategoryOfRelation');
210
211 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
212 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
213 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
214 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
215 }
216
217 /**
218 * @test
219 * @see DataSet/Assertion/copyContentRecordOfCategoryRelation.csv
220 */
221 public function copyContentOfRelation() {
222 parent::copyContentOfRelation();
223 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
224 $this->assertAssertionDataSet('copyContentOfRelation');
225
226 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
227 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
228 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
229 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
230 }
231
232 /**
233 * @test
234 * @see DataSet/Assertion/copyCategoryRecordOfCategoryRelation.csv
235 */
236 public function copyCategoryOfRelation() {
237 parent::copyCategoryOfRelation();
238 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
239 $this->assertAssertionDataSet('copyCategoryOfRelation');
240
241 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
242 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
243 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
244 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
245 }
246
247 /**
248 * @test
249 * @see DataSet/Assertion/localizeContentRecordOfCategoryRelation.csv
250 */
251 public function localizeContentOfRelation() {
252 parent::localizeContentOfRelation();
253 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
254 $this->assertAssertionDataSet('localizeContentOfRelation');
255
256 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
257 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
258 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
259 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
260 }
261
262 /**
263 * @test
264 * @see DataSet/Assertion/localizeCategoryRecordOfCategoryRelation.csv
265 */
266 public function localizeCategoryOfRelation() {
267 parent::localizeCategoryOfRelation();
268 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
269 $this->assertAssertionDataSet('localizeCategoryOfRelation');
270
271 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
272 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
273 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
274 ->setTable(self::TABLE_Category)->setField('title')->setValues('[Translate to Dansk:] Category A', 'Category B'));
275 }
276
277 /**
278 * @test
279 * @see DataSet/Assertion/moveContentRecordOfCategoryRelationToDifferentPage.csv
280 */
281 public function moveContentOfRelationToDifferentPage() {
282 parent::moveContentOfRelationToDifferentPage();
283 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
284 $this->assertAssertionDataSet('moveContentOfRelationToDifferentPage');
285
286 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
287 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
288 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
289 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
290 }
291
292 /**
293 * @test
294 * @see DataSet/Assertion/copyPage.csv
295 */
296 public function copyPage() {
297 parent::copyPage();
298 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
299 $this->assertAssertionDataSet('copyPage');
300
301 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections();
302 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
303 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
304 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
305 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
306 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
307 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'])->setRecordField('categories')
308 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
309 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
310 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'])->setRecordField('categories')
311 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
312 }
313
314 }