Skip to content

Commit

Permalink
Merge pull request #402 from b13/task/v12-content-defender-tests
Browse files Browse the repository at this point in the history
[TASK] reenable content defender tests for v12
  • Loading branch information
achimfritz authored May 5, 2023
2 parents cbdc6a8 + 3a9a923 commit c66416e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,12 @@ jobs:
- name: Unit Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit

- name: Functional Tests with mariadb 10/11
if: matrix.TYPO3 != '12'
- name: Functional Tests with mariadb
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional

- name: Functional Tests with mariadb 12
if: matrix.TYPO3 == '12'
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional -e "--exclude-group=content_defender"

- name: Acceptance Tests 10/11
if: matrix.TYPO3 != '12'
- name: Acceptance Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -e --fail-fast

- name: Acceptance Tests 12
if: matrix.TYPO3 == '12'
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -e "--fail-fast --skip-group=content_defender"

- name: Archive acceptance tests results
uses: actions/upload-artifact@v2
if: always()
Expand Down
2 changes: 1 addition & 1 deletion Build/testing-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ services:
fi
composer prepare-tests-10 && composer prepare-tests
else
composer remove typo3/cms* ichhabrecht/content-defender --dev --no-progress --no-interaction && composer config --no-interaction --no-plugins allow-plugins.sbuerk/typo3-cmscomposerinstallers-testingframework-bridge true && composer require typo3/cms-install:^12.4 typo3/cms-fluid-styled-content:^12.4 typo3/cms-info:^12.4 typo3/cms-workspaces:^12.4 sbuerk/typo3-cmscomposerinstallers-testingframework-bridge:^0.0.1 --dev -W --no-progress --no-interaction
composer config --no-interaction --no-plugins allow-plugins.sbuerk/typo3-cmscomposerinstallers-testingframework-bridge true && composer require typo3/cms-backend:^12.4 sbuerk/typo3-cmscomposerinstallers-testingframework-bridge:^0.0.1 ichhabrecht/content-defender:dev-main --dev -W --no-progress --no-interaction
composer prepare-tests
fi
"
Expand Down
7 changes: 6 additions & 1 deletion Tests/Acceptance/Backend/ContentDefenderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForText('Header Only');
$I->click('Header Only');
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
if ($typo3Version->getMajorVersion() < 12) {
$I->click('Header Only');
} else {
$I->executeJS("document.querySelector('typo3-backend-new-content-element-wizard').shadowRoot.querySelector('button[data-identifier=\"common_header\"]').click()");
}
$I->switchToContentFrame();
$I->wait(0.5);
$I->see('textmedia', 'select');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ public function _initialize(): void
$this->localConfig['configurationToUseInTestInstance']['SYS']['features']['fluidBasedPageModule'] = true;
}
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
if ($typo3Version->getMajorVersion() === 12) {
// without content_defender
$this->localConfig['testExtensionsToLoad'] = [
'typo3conf/ext/container',
'typo3conf/ext/container_example',
];
}
if ($typo3Version->getMajorVersion() === 10) {
$this->localConfig['csvDatabaseFixtures'][] = __DIR__ . '/../../Fixtures/sys_language.csv';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public function canTranslateChildIfContainerOfDefaultLanguageMaxitemsIsReached()
*/
public function canCopyToLanguageChildIfContainerOfDefaultLanguageMaxitemsIsReached(): void
{
$this->importCSVDataSet(ORIGINAL_ROOT . 'typo3conf/ext/container/Tests/Functional/Datahandler/ContentDefender/Fixtures/Maxitems/can_copy_to_language_child_if_container_of_default_language_maxitems_reached.csv');
$this->importCSVDataSet(__DIR__ . '/Fixtures/Maxitems/can_copy_to_language_child_if_container_of_default_language_maxitems_reached.csv');
$cmdmap = [
'tt_content' => [
3 => ['copyToLanguage' => 1],
Expand Down
3 changes: 2 additions & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
// EXT:content_defender
$packageManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\PackageManager::class);
if ($packageManager->isPackageActive('content_defender')) {
if (version_compare($packageManager->getPackage('content_defender')->getPackageMetaData()->getVersion(), '3.1.0', '>=')) {
$contentDefenderVersion = $packageManager->getPackage('content_defender')->getPackageMetaData()->getVersion();
if (version_compare($contentDefenderVersion, '3.1.0', '>=') || $contentDefenderVersion === 'dev-main') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['content_defender']['ColumnConfigurationManipulationHook']['tx_container'] =
\B13\Container\ContentDefender\Hooks\ColumnConfigurationManipulationHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\IchHabRecht\ContentDefender\Hooks\DatamapDataHandlerHook::class] = [
Expand Down

0 comments on commit c66416e

Please sign in to comment.