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