Commit 00c19be7 authored by Christian Kuhn's avatar Christian Kuhn Committed by Andreas Fernandez
Browse files

[TASK] Streamline DataHandler functional tests

* Obsolete importScenarioDataSet() by using
  importCSVDataSet() directly with absolute paths.
  IDE's now resolve these paths so they can be
  clicked to open, which is *much* more convenient
  when working with the .csv files.
* Similar, obsolete assertAssertionDataSet() by using
  assertCSVDataSet() directly.
* Protected constants.
* Late static binding for workspace init in setUp()
  to simplify and streamline workspace test inheritance.
* A couple of minor streamlinings.

Change-Id: I9e814335b863da278e814641f6995a24778da95b
Resolves: #96104
Releases: master, 11.5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72326

Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent c109aa25
......@@ -18,6 +18,7 @@ declare(strict_types=1);
namespace TYPO3\CMS\Backend\Tests\Functional\Controller\Page;
use TYPO3\CMS\Backend\Controller\Page\LocalizationController;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase;
......@@ -27,20 +28,12 @@ use TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCa
*/
class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
{
/**
* @var string
*/
protected $assertionDataSetDirectory = 'typo3/sysext/backend/Tests/Functional/Controller/Page/Localization/CSV/DataSet/';
/**
* @var LocalizationController|\PHPUnit\Framework\MockObject\MockObject
*/
protected $subject;
/**
* @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
*/
protected $backendUser;
protected BackendUserAuthentication $backendUser;
/**
* @var array
......@@ -77,7 +70,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
'action' => LocalizationController::ACTION_LOCALIZE,
];
$this->subject->_call('process', $params);
$this->assertAssertionDataSet('TranslatedFromDefault');
$this->assertCSVDataSet(__DIR__ . '/Localization/CSV/DataSet/TranslatedFromDefault.csv');
}
/**
......@@ -95,7 +88,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
'action' => LocalizationController::ACTION_LOCALIZE,
];
$this->subject->_call('process', $params);
$this->assertAssertionDataSet('TranslatedFromTranslation');
$this->assertCSVDataSet(__DIR__ . '/Localization/CSV/DataSet/TranslatedFromTranslation.csv');
}
/**
......@@ -111,7 +104,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
'action' => LocalizationController::ACTION_COPY,
];
$this->subject->_call('process', $params);
$this->assertAssertionDataSet('CopiedFromDefault');
$this->assertCSVDataSet(__DIR__ . '/Localization/CSV/DataSet/CopiedFromDefault.csv');
}
/**
......@@ -129,7 +122,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
'action' => LocalizationController::ACTION_COPY,
];
$this->subject->_call('process', $params);
$this->assertAssertionDataSet('CopiedFromTranslation');
$this->assertCSVDataSet(__DIR__ . '/Localization/CSV/DataSet/CopiedFromTranslation.csv');
}
/**
......@@ -181,7 +174,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
'action' => LocalizationController::ACTION_COPY,
];
$this->subject->_call('process', $params);
$this->assertAssertionDataSet('CreatedElementOrdering');
$this->assertCSVDataSet(__DIR__ . '/Localization/CSV/DataSet/CreatedElementOrdering.csv');
}
/**
......
......@@ -18,6 +18,7 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Tests\Functional\DataHandling;
use Symfony\Component\Yaml\Yaml;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\WorkspaceAspect;
......@@ -37,17 +38,8 @@ use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
*/
abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
{
const VALUE_BackendUserId = 1;
/**
* @var string
*/
protected $scenarioDataSetDirectory;
/**
* @var string
*/
protected $assertionDataSetDirectory;
protected const VALUE_BackendUserId = 1;
protected const VALUE_WorkspaceId = 0;
/**
* If this value is NULL, log entries are not considered.
......@@ -69,15 +61,8 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
*/
protected $recordIds = [];
/**
* @var ActionService
*/
protected $actionService;
/**
* @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
*/
protected $backendUser;
protected ActionService $actionService;
protected BackendUserAuthentication $backendUser;
/**
* Default Site Configuration
......@@ -115,10 +100,10 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
parent::setUp();
$this->backendUser = $this->setUpBackendUserFromFixture(self::VALUE_BackendUserId);
// By default make tests on live workspace
$this->setWorkspaceId(0);
// Note late static binding - Workspace related tests override the constant
$this->setWorkspaceId(static::VALUE_WorkspaceId);
$this->actionService = $this->getActionService();
$this->actionService = new ActionService();
Bootstrap::initializeLanguageObject();
}
......@@ -183,33 +168,6 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
GeneralUtility::makeInstance(Context::class)->setAspect('workspace', new WorkspaceAspect($workspaceId));
}
/**
* @return ActionService
*/
protected function getActionService(): ActionService
{
return GeneralUtility::makeInstance(
ActionService::class
);
}
/**
* @param string $dataSetName
*/
protected function importScenarioDataSet($dataSetName): void
{
$fileName = rtrim($this->scenarioDataSetDirectory, '/') . '/' . $dataSetName . '.csv';
$fileName = GeneralUtility::getFileAbsFileName($fileName);
$this->importCSVDataSet($fileName);
}
protected function assertAssertionDataSet($dataSetName): void
{
$fileName = rtrim($this->assertionDataSetDirectory, '/') . '/' . $dataSetName . '.csv';
$fileName = GeneralUtility::getFileAbsFileName($fileName);
$this->assertCSVDataSet($fileName);
}
/**
* Asserts correct number of warning and error log entries.
*
......
......@@ -39,10 +39,7 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
protected const FIELD_Categories = 'categories';
/**
* @var string
*/
protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/ManyToMany/DataSet/';
protected const SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefault.csv';
protected $testExtensionsToLoad = [
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial',
......@@ -51,7 +48,7 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
protected function setUp(): void
{
parent::setUp();
$this->importScenarioDataSet('ImportDefault');
$this->importCSVDataSet(static::SCENARIO_DataSet);
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
......
......@@ -26,11 +26,6 @@ use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
*/
class ActionTest extends AbstractActionTestCase
{
/**
* @var string
*/
protected $assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/ManyToMany/Modify/DataSet/';
/**
* @test
*/
......@@ -47,7 +42,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelation(): void
{
parent::addCategoryRelation();
$this->assertAssertionDataSet('addCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -67,7 +62,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelations(): void
{
parent::addCategoryRelations();
$this->assertAssertionDataSet('addCategoryRelations');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelations.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -87,7 +82,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelationToExisting(): void
{
parent::addCategoryRelationToExisting();
$this->assertAssertionDataSet('addCategoryRelationToExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelationToExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -107,7 +102,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelationsToExisting(): void
{
parent::addCategoryRelationsToExisting();
$this->assertAssertionDataSet('addCategoryRelationsToExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelationsToExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -127,7 +122,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndAddCategoryRelation(): void
{
parent::createAndAddCategoryRelation();
$this->assertAssertionDataSet('createAndAddCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndAddCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -160,7 +155,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndReplaceCategoryRelation(): void
{
parent::createAndReplaceCategoryRelation();
$this->assertAssertionDataSet('createAndReplaceCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndReplaceCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -186,7 +181,7 @@ class ActionTest extends AbstractActionTestCase
public function addAndDeleteCategoryRelationsOnExisting(): void
{
parent::addAndDeleteCategoryRelationsOnExisting();
$this->assertAssertionDataSet('addAndDeleteCategoryRelationsOnExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addAndDeleteCategoryRelationsOnExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -206,7 +201,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyReferencingContentElement(): void
{
parent::modifyReferencingContentElement();
$this->assertAssertionDataSet('modifyReferencingContentElement');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyReferencingContentElement.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -225,7 +220,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyContentOfRelatedCategory(): void
{
parent::modifyContentOfRelatedCategory();
$this->assertAssertionDataSet('modifyContentOfRelatedCategory');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyContentOfRelatedCategory.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -245,7 +240,7 @@ class ActionTest extends AbstractActionTestCase
public function moveContentAndCategoryRelationToDifferentPage(): void
{
parent::moveContentAndCategoryRelationToDifferentPage();
$this->assertAssertionDataSet('moveContentAndCategoryRelationToDifferentPage');
$this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentAndCategoryRelationToDifferentPage.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_TargetPageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -265,7 +260,7 @@ class ActionTest extends AbstractActionTestCase
public function changeContentAndCategorySorting(): void
{
parent::changeContentAndCategorySorting();
$this->assertAssertionDataSet('changeContentAndCategorySorting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentAndCategorySorting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -285,7 +280,7 @@ class ActionTest extends AbstractActionTestCase
public function deleteCategoryRelation(): void
{
parent::deleteCategoryRelation();
$this->assertAssertionDataSet('deleteCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/deleteCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -312,7 +307,7 @@ class ActionTest extends AbstractActionTestCase
public function deleteCategoryRelations(): void
{
parent::deleteCategoryRelations();
$this->assertAssertionDataSet('deleteCategoryRelations');
$this->assertCSVDataSet(__DIR__ . '/DataSet/deleteCategoryRelations.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......
......@@ -39,19 +39,16 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
protected const FIELD_Categories = 'tx_testdatahandler_categories';
protected const SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefault.csv';
protected $testExtensionsToLoad = [
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler',
];
/**
* @var string
*/
protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/OneToMany/DataSet/';
protected function setUp(): void
{
parent::setUp();
$this->importScenarioDataSet('ImportDefault');
$this->importCSVDataSet(static::SCENARIO_DataSet);
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
......
......@@ -26,11 +26,6 @@ use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
*/
class ActionTest extends AbstractActionTestCase
{
/**
* @var string
*/
protected $assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/OneToMany/Modify/DataSet/';
/**
* @test
*/
......@@ -47,7 +42,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelation(): void
{
parent::addCategoryRelation();
$this->assertAssertionDataSet('addCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -67,7 +62,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelations(): void
{
parent::addCategoryRelations();
$this->assertAssertionDataSet('addCategoryRelations');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelations.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -87,7 +82,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelationToExisting(): void
{
parent::addCategoryRelationToExisting();
$this->assertAssertionDataSet('addCategoryRelationToExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelationToExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -107,7 +102,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelationsToExisting(): void
{
parent::addCategoryRelationsToExisting();
$this->assertAssertionDataSet('addCategoryRelationsToExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelationsToExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -127,7 +122,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndAddCategoryRelation(): void
{
parent::createAndAddCategoryRelation();
$this->assertAssertionDataSet('createAndAddCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndAddCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -160,7 +155,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndReplaceCategoryRelation(): void
{
parent::createAndReplaceCategoryRelation();
$this->assertAssertionDataSet('createAndReplaceCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndReplaceCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -186,7 +181,7 @@ class ActionTest extends AbstractActionTestCase
public function addAndDeleteCategoryRelationsOnExisting(): void
{
parent::addAndDeleteCategoryRelationsOnExisting();
$this->assertAssertionDataSet('addAndDeleteCategoryRelationsOnExisting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addAndDeleteCategoryRelationsOnExisting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -206,7 +201,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyReferencingContentElement(): void
{
parent::modifyReferencingContentElement();
$this->assertAssertionDataSet('modifyReferencingContentElement');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyReferencingContentElement.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -225,7 +220,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyContentOfRelatedCategory(): void
{
parent::modifyContentOfRelatedCategory();
$this->assertAssertionDataSet('modifyContentOfRelatedCategory');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyContentOfRelatedCategory.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -245,7 +240,7 @@ class ActionTest extends AbstractActionTestCase
public function moveContentAndCategoryRelationToDifferentPage(): void
{
parent::moveContentAndCategoryRelationToDifferentPage();
$this->assertAssertionDataSet('moveContentAndCategoryRelationToDifferentPage');
$this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentAndCategoryRelationToDifferentPage.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_TargetPageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -265,7 +260,7 @@ class ActionTest extends AbstractActionTestCase
public function changeContentAndCategorySorting(): void
{
parent::changeContentAndCategorySorting();
$this->assertAssertionDataSet('changeContentAndCategorySorting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentAndCategorySorting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -285,7 +280,7 @@ class ActionTest extends AbstractActionTestCase
public function deleteCategoryRelation(): void
{
parent::deleteCategoryRelation();
$this->assertAssertionDataSet('deleteCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/deleteCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -312,7 +307,7 @@ class ActionTest extends AbstractActionTestCase
public function deleteCategoryRelations(): void
{
parent::deleteCategoryRelations();
$this->assertAssertionDataSet('deleteCategoryRelations');
$this->assertCSVDataSet(__DIR__ . '/DataSet/deleteCategoryRelations.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......
......@@ -39,20 +39,17 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
protected const FIELD_Category = 'tx_testdatahandler_category';
protected const SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefault.csv';
protected $testExtensionsToLoad = [
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial',
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler',
];
/**
* @var string
*/
protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/OneToOne/DataSet/';
protected function setUp(): void
{
parent::setUp();
$this->importScenarioDataSet('ImportDefault');
$this->importCSVDataSet(static::SCENARIO_DataSet);
$this->setUpFrontendSite(1, $this->siteLanguageConfiguration);
$this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
......
......@@ -26,11 +26,6 @@ use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
*/
class ActionTest extends AbstractActionTestCase
{
/**
* @var string
*/
protected $assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Category/OneToOne/Modify/DataSet/';
/**
* @test
*/
......@@ -47,7 +42,7 @@ class ActionTest extends AbstractActionTestCase
public function addCategoryRelation(): void
{
parent::addCategoryRelation();
$this->assertAssertionDataSet('addCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/addCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -67,7 +62,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndAddCategoryRelation(): void
{
parent::createAndAddCategoryRelation();
$this->assertAssertionDataSet('createAndAddCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndAddCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -93,7 +88,7 @@ class ActionTest extends AbstractActionTestCase
public function createAndReplaceCategoryRelation(): void
{
parent::createAndReplaceCategoryRelation();
$this->assertAssertionDataSet('createAndReplaceCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/createAndReplaceCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -119,7 +114,7 @@ class ActionTest extends AbstractActionTestCase
public function changeExistingCategoryRelation(): void
{
parent::changeExistingCategoryRelation();
$this->assertAssertionDataSet('changeExistingCategoryRelation');
$this->assertCSVDataSet(__DIR__ . '/DataSet/changeExistingCategoryRelation.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -139,7 +134,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyReferencingContentElement(): void
{
parent::modifyReferencingContentElement();
$this->assertAssertionDataSet('modifyReferencingContentElement');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyReferencingContentElement.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -158,7 +153,7 @@ class ActionTest extends AbstractActionTestCase
public function modifyContentOfRelatedCategory(): void
{
parent::modifyContentOfRelatedCategory();
$this->assertAssertionDataSet('modifyContentOfRelatedCategory');
$this->assertCSVDataSet(__DIR__ . '/DataSet/modifyContentOfRelatedCategory.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -178,7 +173,7 @@ class ActionTest extends AbstractActionTestCase
public function moveContentAndCategoryRelationToDifferentPage(): void
{
parent::moveContentAndCategoryRelationToDifferentPage();
$this->assertAssertionDataSet('moveContentAndCategoryRelationToDifferentPage');
$this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentAndCategoryRelationToDifferentPage.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_TargetPageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -198,7 +193,7 @@ class ActionTest extends AbstractActionTestCase
public function changeContentAndCategorySorting(): void
{
parent::changeContentAndCategorySorting();
$this->assertAssertionDataSet('changeContentAndCategorySorting');
$this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentAndCategorySorting.csv');
$response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
$responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
......@@ -218,7 +213,7 @@ class ActionTest extends AbstractActionTestCase
public function copyContentAndCategoryRelation(): void
{
parent::copyContentAndCategoryRelation();