Commit f4b38502 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Drop deprecated testing-framework method usages

Functional test case methods getFrontendResponse() and
getFrontendResult() have been deprecated a while ago
but their core usages have not been adapted. Do this
now by switching to their younger counterparts.

Change-Id: Ica1a6625a29b9d35189f2c9fce29da52f121d280
Resolves: #92845
Releases: master, 10.4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66635


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 2375da55
......@@ -16,6 +16,8 @@
namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\FAL\Modify;
use TYPO3\CMS\Core\Tests\Functional\DataHandling\FAL\AbstractActionTestCase;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
/**
* Functional test for the DataHandler
......@@ -45,7 +47,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContent();
$this->assertAssertionDataSet('modifyContent');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -62,7 +65,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteContent();
$this->assertAssertionDataSet('deleteContent');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
self::assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
......@@ -78,7 +82,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyContent();
$this->assertAssertionDataSet('copyContent');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -100,7 +105,8 @@ class ActionTest extends AbstractActionTestCase
$languageConfiguration = $this->siteLanguageConfiguration;
$languageConfiguration[1]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #2'));
......@@ -118,7 +124,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContent();
$this->assertAssertionDataSet('localizeContent');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
......@@ -136,7 +143,8 @@ class ActionTest extends AbstractActionTestCase
parent::changeContentSorting();
$this->assertAssertionDataSet('changeContentSorting');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -156,13 +164,15 @@ class ActionTest extends AbstractActionTestCase
parent::moveContentToDifferentPage();
$this->assertAssertionDataSet('moveContentToDifferentPage');
$responseSectionsSource = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSectionsSource, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
self::assertThat($responseSectionsSource, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentImage)
->setTable(self::TABLE_FileReference)->setField('title')->setValues('Kasper', 'T3BOARD'));
$responseSectionsTarget = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
$responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSectionsTarget, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
self::assertThat($responseSectionsTarget, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -179,7 +189,8 @@ class ActionTest extends AbstractActionTestCase
parent::moveContentToDifferentPageAndChangeSorting();
$this->assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
$responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -203,7 +214,8 @@ class ActionTest extends AbstractActionTestCase
parent::createContentWithFileReference();
$this->assertAssertionDataSet('createContentWFileReference');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -220,7 +232,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentWithFileReference();
$this->assertAssertionDataSet('modifyContentWFileReference');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -237,7 +250,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentAndAddFileReference();
$this->assertAssertionDataSet('modifyContentNAddFileReference');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD', 'This is Kasper', 'Image #3'));
......@@ -252,7 +266,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentAndDeleteFileReference();
$this->assertAssertionDataSet('modifyContentNDeleteFileReference');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper'));
......@@ -270,7 +285,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentAndDeleteAllFileReference();
$this->assertAssertionDataSet('modifyContentNDeleteAllFileReference');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
->setTable(self::TABLE_FileReference)->setField('title')->setValues('Taken at T3BOARD', 'This is Kasper'));
......
......@@ -16,6 +16,8 @@
namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Modify;
use TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\AbstractActionTestCase;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
/**
* Functional test for the DataHandler
......@@ -45,7 +47,8 @@ class ActionTest extends AbstractActionTestCase
parent::addElementRelation();
$this->assertAssertionDataSet('addElementRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2', 'Element #3'));
......@@ -60,7 +63,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteElementRelation();
$this->assertAssertionDataSet('deleteElementRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1'));
......@@ -78,7 +82,8 @@ class ActionTest extends AbstractActionTestCase
parent::changeElementSorting();
$this->assertAssertionDataSet('changeElementSorting');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
......@@ -93,7 +98,8 @@ class ActionTest extends AbstractActionTestCase
parent::changeElementRelationSorting();
$this->assertAssertionDataSet('changeElementRelationSorting');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
......@@ -108,7 +114,8 @@ class ActionTest extends AbstractActionTestCase
parent::createContentAndAddElementRelation();
$this->assertAssertionDataSet('createContentNAddRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -124,7 +131,8 @@ class ActionTest extends AbstractActionTestCase
parent::createContentAndCreateElementRelation();
$this->assertAssertionDataSet('createContentNCreateRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
......@@ -141,7 +149,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyElementOfRelation();
$this->assertAssertionDataSet('modifyElementOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Testing #1', 'Element #2'));
......@@ -156,7 +165,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentOfRelation();
$this->assertAssertionDataSet('modifyContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
}
......@@ -170,7 +180,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyBothSidesOfRelation();
$this->assertAssertionDataSet('modifyBothSidesOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Testing #1', 'Element #2'));
......@@ -187,7 +198,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteContentOfRelation();
$this->assertAssertionDataSet('deleteContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
}
......@@ -201,7 +213,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteElementOfRelation();
$this->assertAssertionDataSet('deleteElementOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1'));
......@@ -216,7 +229,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyContentOfRelation();
$this->assertAssertionDataSet('copyContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
// Referenced elements are not copied with the "parent", which is expected and correct
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentElement)
......@@ -232,7 +246,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyElementOfRelation();
$this->assertAssertionDataSet('copyElementOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1'));
......@@ -258,7 +273,8 @@ class ActionTest extends AbstractActionTestCase
$languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free';
$this->setUpFrontendSite(1, $languageConfiguration);
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #2', 'Element #3'));
......@@ -277,7 +293,8 @@ class ActionTest extends AbstractActionTestCase
//in this case the translated element is orphaned (no CE with relation to it, and it has no l10n_parent)
//so on frontend there is no change.
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
......@@ -292,7 +309,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentOfRelation();
$this->assertAssertionDataSet('localizeContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #2', 'Element #3'));
......@@ -307,7 +325,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentOfRelationWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeContentOfRelationWSynchronization');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
......@@ -322,7 +341,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentChainOfRelationWithLanguageSynchronizationSource();
$this->assertAssertionDataSet('localizeContentChainOfRelationWSynchronizationSource');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
......@@ -339,7 +359,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeElementOfRelation();
$this->assertAssertionDataSet('localizeElementOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('[Translate to Dansk:] Element #1', 'Element #2'));
......@@ -354,7 +375,8 @@ class ActionTest extends AbstractActionTestCase
parent::moveContentOfRelationToDifferentPage();
$this->assertAssertionDataSet('moveContentOfRelationToDifferentPage');
$responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #2', 'Element #3'));
......
......@@ -16,6 +16,8 @@
namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMany\Modify;
use TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
/**
* Functional test for the DataHandler
......@@ -45,7 +47,8 @@ class ActionTest extends AbstractActionTestCase
parent::addCategoryRelation();
$this->assertAssertionDataSet('addCategoryRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B', 'Category A.A'));
......@@ -60,7 +63,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteCategoryRelation();
$this->assertAssertionDataSet('deleteCategoryRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
......@@ -78,7 +82,8 @@ class ActionTest extends AbstractActionTestCase
parent::changeCategoryRelationSorting();
$this->assertAssertionDataSet('changeCategoryRelationSorting');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
......@@ -93,7 +98,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyCategoryOfRelation();
$this->assertAssertionDataSet('modifyCategoryOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
......@@ -108,7 +114,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyContentOfRelation();
$this->assertAssertionDataSet('modifyContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
}
......@@ -122,7 +129,8 @@ class ActionTest extends AbstractActionTestCase
parent::modifyBothsOfRelation();
$this->assertAssertionDataSet('modifyBothsOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
......@@ -139,7 +147,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteContentOfRelation();
$this->assertAssertionDataSet('deleteContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
}
......@@ -153,7 +162,8 @@ class ActionTest extends AbstractActionTestCase
parent::deleteCategoryOfRelation();
$this->assertAssertionDataSet('deleteCategoryOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
......@@ -168,7 +178,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyContentOfRelation();
$this->assertAssertionDataSet('copyContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
......@@ -183,7 +194,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyCategoryOfRelation();
$this->assertAssertionDataSet('copyCategoryOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
......@@ -198,7 +210,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyContentToLanguageOfRelation();
$this->assertAssertionDataSet('copyContentToLanguageOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
......@@ -214,7 +227,8 @@ class ActionTest extends AbstractActionTestCase
$this->assertAssertionDataSet('copyCategoryToLanguageOfRelation');
//in this case the translated element is orphaned (no CE with relation to it, and it has no l10n_parent)
//so on frontend there is no change.
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
......@@ -229,7 +243,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentOfRelation();
$this->assertAssertionDataSet('localizeContentOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
......@@ -244,7 +259,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentOfRelationWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeContentOfRelationWSynchronization');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
......@@ -259,7 +275,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentOfRelationAndAddCategoryWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeContentOfRelationNAddCategoryWSynchronization');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C', 'Category A.A'));
......@@ -274,7 +291,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization();
$this->assertAssertionDataSet('localizeContentChainOfRelationNAddCategoryWSynchronization');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C', 'Category A.A'));
......@@ -291,7 +309,8 @@ class ActionTest extends AbstractActionTestCase
parent::localizeCategoryOfRelation();
$this->assertAssertionDataSet('localizeCategoryOfRelation');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('[Translate to Dansk:] Category A', 'Category B'));
......@@ -306,7 +325,8 @@ class ActionTest extends AbstractActionTestCase
parent::moveContentOfRelationToDifferentPage();
$this->assertAssertionDataSet('moveContentOfRelationToDifferentPage');
$responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
......@@ -321,7 +341,8 @@ class ActionTest extends AbstractActionTestCase
parent::copyPage();
$this->assertAssertionDataSet('copyPage');
$responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections();
$response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
self::assertThat($responseSections, $t