‪TYPO3CMS  9.5
ActionTest.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 {
25  protected ‪$assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/DataSet/';
26 
35  public function ‪modifyContent()
36  {
37  parent::modifyContent();
38  $this->‪assertAssertionDataSet('modifyContent');
39 
40  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
41  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
42  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
43  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
44  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
45  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD')->setStrict(true));
46  }
47 
52  public function ‪deleteContent()
53  {
54  parent::deleteContent();
55  $this->‪assertAssertionDataSet('deleteContent');
56 
57  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
58  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
59  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
60  $this->assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
61  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
62  }
63 
68  public function ‪copyContent()
69  {
70  parent::copyContent();
71  $this->‪assertAssertionDataSet('copyContent');
72 
73  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
74  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
75  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
76  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
77  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentImage)
78  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD')->setStrict(true));
79  }
80 
85  public function ‪localizeContent()
86  {
87  parent::localizeContent();
88  $this->‪assertAssertionDataSet('localizeContent');
89 
90  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
91  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
92  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
93 
94  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
95  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
96  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(true));
97  }
98 
103  public function ‪changeContentSorting()
104  {
105  parent::changeContentSorting();
106  $this->‪assertAssertionDataSet('changeContentSorting');
107 
108  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
109  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
110  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
111  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
112  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentImage)
113  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Kasper', 'T3BOARD'));
114  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
115  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
116  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD')->setStrict(true));
117  }
118 
123  public function ‪moveContentToDifferentPage()
124  {
125  parent::moveContentToDifferentPage();
126  $this->‪assertAssertionDataSet('moveContentToDifferentPage');
127 
128  $responseSectionsSource = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
129  $this->assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
130  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
131  $this->assertThat($responseSectionsSource, $this->‪getRequestSectionStructureHasRecordConstraint()
132  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentImage)
133  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Kasper', 'T3BOARD')->setStrict(true));
134 
135  $responseSectionsTarget = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
136  $this->assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
137  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
138  $this->assertThat($responseSectionsTarget, $this->‪getRequestSectionStructureHasRecordConstraint()
139  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
140  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD')->setStrict(true));
141  }
142 
148  {
149  parent::moveContentToDifferentPageAndChangeSorting();
150  $this->‪assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
151 
152  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
153  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
154  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
155  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
156  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentImage)
157  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Kasper', 'T3BOARD')->setStrict(true));
158  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
159  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
160  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD')->setStrict(true));
161  }
162 
171  public function ‪createContentWithFileReference()
172  {
173  parent::createContentWithFileReference();
174  $this->‪assertAssertionDataSet('createContentWFileReference');
175 
176  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
177  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
178  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
179  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
180  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentImage)
181  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Image #1')->setStrict(true));
182  }
183 
188  public function ‪modifyContentWithFileReference()
189  {
190  parent::modifyContentWithFileReference();
191  $this->‪assertAssertionDataSet('modifyContentWFileReference');
192 
193  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
194  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
195  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
196  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
197  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
198  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD', 'Image #1')->setStrict(true));
199  }
200 
205  public function ‪modifyContentAndAddFileReference()
206  {
207  parent::modifyContentAndAddFileReference();
208  $this->‪assertAssertionDataSet('modifyContentNAddFileReference');
209 
210  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
211  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
212  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
213  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD', 'This is Kasper', 'Image #3')->setStrict(true));
214  }
215 
221  {
222  parent::modifyContentAndDeleteFileReference();
223  $this->‪assertAssertionDataSet('modifyContentNDeleteFileReference');
224 
225  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
226  $this->assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
227  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
228  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper')->setStrict(true));
229  $this->assertThat($responseSections, $this->‪getRequestSectionStructureDoesNotHaveRecordConstraint()
230  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
231  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD'));
232  }
233 
239  {
240  parent::modifyContentAndDeleteAllFileReference();
241  $this->‪assertAssertionDataSet('modifyContentNDeleteAllFileReference');
242 
243  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
244  $this->assertThat($responseSections, $this->‪getRequestSectionStructureDoesNotHaveRecordConstraint()
245  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
246  ->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD', 'This is Kasper'));
247  }
248 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:174
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:84
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionStructureHasRecordConstraint
‪StructureHasRecordConstraint getRequestSectionStructureHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:190
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\createContentWithFileReference
‪createContentWithFileReference()
Definition: ActionTest.php:170
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:34
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:146
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:122
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionStructureDoesNotHaveRecordConstraint
‪StructureDoesNotHaveRecordConstraint getRequestSectionStructureDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:198
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\modifyContentWithFileReference
‪modifyContentWithFileReference()
Definition: ActionTest.php:187
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\modifyContentAndAddFileReference
‪modifyContentAndAddFileReference()
Definition: ActionTest.php:204
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:67
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:51
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: ActionTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:124
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:182
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\modifyContentAndDeleteAllFileReference
‪modifyContentAndDeleteAllFileReference()
Definition: ActionTest.php:237
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\AbstractActionTestCase
Definition: AbstractActionTestCase.php:21
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\modifyContentAndDeleteFileReference
‪modifyContentAndDeleteFileReference()
Definition: ActionTest.php:219
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest
Definition: ActionTest.php:21
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:102
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL\Modify
Definition: ActionTest.php:2