From 5d425b99dcb7a01f4d72a6e312bc19af94542617 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Fri, 13 Dec 2024 11:26:50 +0100 Subject: [PATCH 01/10] [WIP] typo3 v13 support, drop support for v11 --- .../FieldValidator/PowermailV11Validator.php | 1 + Classes/Form/CustomFormElement.php | 2 +- .../ViewHelpers/ConfigurationViewHelper.php | 2 +- .../ConfigurationViewHelperTest.php | 2 +- composer.json | 4 ++-- ext_emconf.php | 21 ------------------- 6 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 ext_emconf.php diff --git a/Classes/FieldValidator/PowermailV11Validator.php b/Classes/FieldValidator/PowermailV11Validator.php index e7f55c5..4ffe223 100644 --- a/Classes/FieldValidator/PowermailV11Validator.php +++ b/Classes/FieldValidator/PowermailV11Validator.php @@ -48,6 +48,7 @@ protected function isFormWithCaptchaField($mail): bool protected function isCaptchaCheckToSkip(): bool { if (property_exists($this, 'flexForm')) { + // @TODO: flexForm null in powermail v13 $confirmationActive = $this->flexForm['settings']['flexform']['main']['confirmation'] === '1'; $optinActive = $this->flexForm['settings']['flexform']['main']['optin'] === '1'; diff --git a/Classes/Form/CustomFormElement.php b/Classes/Form/CustomFormElement.php index 2f47d92..9b2eb4e 100644 --- a/Classes/Form/CustomFormElement.php +++ b/Classes/Form/CustomFormElement.php @@ -10,7 +10,7 @@ class CustomFormElement extends GenericFormElement { - public function initializeFormElement() + public function initializeFormElement(): void { $this->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); } diff --git a/Classes/ViewHelpers/ConfigurationViewHelper.php b/Classes/ViewHelpers/ConfigurationViewHelper.php index ea05c4f..f3fcaa6 100644 --- a/Classes/ViewHelpers/ConfigurationViewHelper.php +++ b/Classes/ViewHelpers/ConfigurationViewHelper.php @@ -12,7 +12,7 @@ class ConfigurationViewHelper extends AbstractViewHelper { use CompileWithRenderStatic; - public static function render() + public function render(): array { $configuration = new Configuration(); return [ diff --git a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php index 19e0626..c2f9951 100644 --- a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php @@ -15,7 +15,7 @@ class ConfigurationViewHelperTest extends BaseTestCase /** * @test */ - public function viewHelperReturnsProperConfiguration() + public function viewHelperReturnsProperConfiguration(): void { self::setupRequest(); $configurationViewHelper = new ConfigurationViewHelper(); diff --git a/composer.json b/composer.json index f3fb2e1..c85ddfc 100644 --- a/composer.json +++ b/composer.json @@ -5,12 +5,12 @@ "homepage": "https://www.studiomitte.com", "license": "GPL-2.0-or-later", "require": { - "typo3/cms-core": "^11.5.30 || ^12.4.5" + "typo3/cms-core": "^12.4.5 || ^13.4" }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", "typo3/testing-framework": "^7.0.1", - "typo3/cms-form": "^11.5.30 || ^12.4.5", + "typo3/cms-form": "^12.4.5 || ^13.4", "phpunit/phpunit": "^9", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", diff --git a/ext_emconf.php b/ext_emconf.php deleted file mode 100644 index 40d3ef0..0000000 --- a/ext_emconf.php +++ /dev/null @@ -1,21 +0,0 @@ - 'Integration of Friendly Captcha', - 'description' => 'FriendlyCaptcha Integration for EXT:powermail and EXT:form and your custom implementation', - 'category' => 'plugin', - 'constraints' => [ - 'depends' => [ - 'typo3' => '11.5.0-12.9.99', - ], - 'conflicts' => [ - ], - ], - 'autoload' => [ - 'psr-4' => [ - 'StudioMitte\\FriendlyCaptcha\\' => 'Classes', - ], - ], - 'state' => 'beta', - 'version' => '1.0.0', -]; From b5d6d6214937d48c2170ac70763ad51f71535691 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Mon, 16 Dec 2024 08:37:19 +0100 Subject: [PATCH 02/10] [TASK] Add core13 pipeline --- .github/workflows/{core11.yml => core13.yml} | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) rename .github/workflows/{core11.yml => core13.yml} (56%) diff --git a/.github/workflows/core11.yml b/.github/workflows/core13.yml similarity index 56% rename from .github/workflows/core11.yml rename to .github/workflows/core13.yml index 495cc74..1c0bc45 100644 --- a/.github/workflows/core11.yml +++ b/.github/workflows/core13.yml @@ -1,33 +1,30 @@ -name: core 11 +name: core 13 on: [ push, pull_request ] jobs: tests: - name: v11 + name: v13 runs-on: ubuntu-20.04 strategy: # This prevents cancellation of matrix job runs, if one/two already failed and let the # rest matrix jobs be executed anyway. fail-fast: false matrix: - php: [ '7.4', '8.0', '8.1', '8.2' ] + php: [ '8.2', '8.3' ] composerInstall: [ 'composerInstallLowest', 'composerInstallHighest' ] steps: - name: Checkout uses: actions/checkout@v3 - - name: Validate composer.json and composer.lock - run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s composer -e 'validate' - - name: Install testing system - run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} + run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} - name: Lint PHP - run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s lint + run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s lint - name: Validate code against CGL - run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 11 -p 8.2 -s cgl -n + run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 13 -p 8.3 -s cgl -n - name: Unit Tests - run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s unit + run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s unit From ff04224e34c08d15a8205238ea9a387cee908fe1 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Mon, 16 Dec 2024 08:39:57 +0100 Subject: [PATCH 03/10] csfix --- Build/phpunit/FunctionalTestsBootstrap.php | 1 + Build/phpunit/UnitTestsBootstrap.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php index a95bc52..9882f8f 100644 --- a/Build/phpunit/FunctionalTestsBootstrap.php +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -1,4 +1,5 @@ Date: Mon, 16 Dec 2024 09:11:55 +0100 Subject: [PATCH 04/10] Return support for typo3 v11 --- Classes/ViewHelpers/ConfigurationViewHelper.php | 3 --- composer.json | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Classes/ViewHelpers/ConfigurationViewHelper.php b/Classes/ViewHelpers/ConfigurationViewHelper.php index f3fcaa6..1eb4565 100644 --- a/Classes/ViewHelpers/ConfigurationViewHelper.php +++ b/Classes/ViewHelpers/ConfigurationViewHelper.php @@ -6,12 +6,9 @@ use StudioMitte\FriendlyCaptcha\Configuration; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; class ConfigurationViewHelper extends AbstractViewHelper { - use CompileWithRenderStatic; - public function render(): array { $configuration = new Configuration(); diff --git a/composer.json b/composer.json index c85ddfc..11593ca 100644 --- a/composer.json +++ b/composer.json @@ -5,12 +5,12 @@ "homepage": "https://www.studiomitte.com", "license": "GPL-2.0-or-later", "require": { - "typo3/cms-core": "^12.4.5 || ^13.4" + "typo3/cms-core": "^11.5.30 || ^12.4.5 || ^13.4" }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", "typo3/testing-framework": "^7.0.1", - "typo3/cms-form": "^12.4.5 || ^13.4", + "typo3/cms-form": "^11.5.30 || ^12.4.5 || ^13.4", "phpunit/phpunit": "^9", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", From a269d183b894594a5bfba4459307da9ec6dc76f1 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Mon, 16 Dec 2024 09:56:52 +0100 Subject: [PATCH 05/10] Drop typo3 v11 support --- .../FieldValidator/PowermailV11Validator.php | 69 ------------------- Classes/FieldValidator/PowermailValidator.php | 29 ++------ .../TypoScript/Powermail/setup.typoscript | 12 ---- composer.json | 4 +- 4 files changed, 8 insertions(+), 106 deletions(-) delete mode 100644 Classes/FieldValidator/PowermailV11Validator.php diff --git a/Classes/FieldValidator/PowermailV11Validator.php b/Classes/FieldValidator/PowermailV11Validator.php deleted file mode 100644 index 4ffe223..0000000 --- a/Classes/FieldValidator/PowermailV11Validator.php +++ /dev/null @@ -1,69 +0,0 @@ -isFormWithCaptchaField($mail) || $this->isCaptchaCheckToSkip()) { - return; - } - - $friendlyCaptchaService = GeneralUtility::makeInstance(Api::class); - if (!$friendlyCaptchaService->verify()) { - $this->addError( - $this->translateErrorMessage('message.invalid', 'friendlycaptcha_official'), - 1689157219, - ); - } - } - - protected function isFormWithCaptchaField($mail): bool - { - foreach ($mail->getForm()->getPages() as $page) { - foreach ($page->getFields() as $field) { - if ($field->getType() === 'friendlycaptcha') { - return true; - } - } - } - return false; - } - - /** - * Captcha check should be skipped on createAction if there was a confirmationAction where the captcha was - * already checked before - * Note: $this->flexForm is only available in powermail 3.9 or newer - */ - protected function isCaptchaCheckToSkip(): bool - { - if (property_exists($this, 'flexForm')) { - // @TODO: flexForm null in powermail v13 - $confirmationActive = $this->flexForm['settings']['flexform']['main']['confirmation'] === '1'; - $optinActive = $this->flexForm['settings']['flexform']['main']['optin'] === '1'; - - return $this->getActionName() === 'create' && $confirmationActive - || $this->getActionName() === 'optinConfirm' && $optinActive; - } - return false; - } - - /** - * @return string "confirmation" or "create" - */ - protected function getActionName(): string - { - $pluginVariables = GeneralUtility::_GPmerged('tx_powermail_pi1'); - return $pluginVariables['action']; - } -} diff --git a/Classes/FieldValidator/PowermailValidator.php b/Classes/FieldValidator/PowermailValidator.php index 8fd52ca..e03853e 100644 --- a/Classes/FieldValidator/PowermailValidator.php +++ b/Classes/FieldValidator/PowermailValidator.php @@ -6,39 +6,26 @@ use In2code\Powermail\Domain\Validator\AbstractValidator; use StudioMitte\FriendlyCaptcha\Service\Api; -use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Error\Error; -use TYPO3\CMS\Extbase\Error\Result; class PowermailValidator extends AbstractValidator { /** * @param Mail $mail - * @return Result */ - public function validate($mail): Result + public function isValid($mail): void { - $result = new Result(); if (!$this->isFormWithCaptchaField($mail) || $this->isCaptchaCheckToSkip()) { - return $result; + return; } $friendlyCaptchaService = GeneralUtility::makeInstance(Api::class); if (!$friendlyCaptchaService->verify()) { - $result->addError( - new Error( - $this->getLanguageService()->sL('LLL:EXT:friendlycaptcha_official/Resources/Private/Language/locallang.xlf:message.invalid'), - 1689157219 - ) + $this->addError( + $this->translateErrorMessage('message.invalid', 'friendlycaptcha_official'), + 1689157219, ); } - return $result; - } - - public function isValid(mixed $mail): void - { - return; } protected function isFormWithCaptchaField($mail): bool @@ -61,6 +48,7 @@ protected function isFormWithCaptchaField($mail): bool protected function isCaptchaCheckToSkip(): bool { if (property_exists($this, 'flexForm')) { + // @TODO: flexForm null in powermail v13 $confirmationActive = $this->flexForm['settings']['flexform']['main']['confirmation'] === '1'; $optinActive = $this->flexForm['settings']['flexform']['main']['optin'] === '1'; @@ -78,9 +66,4 @@ protected function getActionName(): string $pluginVariables = GeneralUtility::_GPmerged('tx_powermail_pi1'); return $pluginVariables['action']; } - - private function getLanguageService(): LanguageService - { - return $GLOBALS['LANG']; - } } diff --git a/Configuration/TypoScript/Powermail/setup.typoscript b/Configuration/TypoScript/Powermail/setup.typoscript index 4c0b2b8..96dd0fe 100644 --- a/Configuration/TypoScript/Powermail/setup.typoscript +++ b/Configuration/TypoScript/Powermail/setup.typoscript @@ -15,15 +15,3 @@ plugin.tx_powermail { } } } - -[compatVersion("12.4")] - plugin.tx_powermail.settings.setup.validators { - 981818 { - class = StudioMitte\FriendlyCaptcha\FieldValidator\PowermailV11Validator - config { - # Until https://github.com/in2code-de/powermail/pull/941 is merged & released - dummy = 1 - } - } - } -[global] diff --git a/composer.json b/composer.json index 11593ca..c85ddfc 100644 --- a/composer.json +++ b/composer.json @@ -5,12 +5,12 @@ "homepage": "https://www.studiomitte.com", "license": "GPL-2.0-or-later", "require": { - "typo3/cms-core": "^11.5.30 || ^12.4.5 || ^13.4" + "typo3/cms-core": "^12.4.5 || ^13.4" }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", "typo3/testing-framework": "^7.0.1", - "typo3/cms-form": "^11.5.30 || ^12.4.5 || ^13.4", + "typo3/cms-form": "^12.4.5 || ^13.4", "phpunit/phpunit": "^9", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", From 890a7c90a1ec1c2f56d1c4fe1227687f1cd7439c Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Tue, 17 Dec 2024 08:12:50 +0100 Subject: [PATCH 06/10] Update Powermail Validator --- Classes/FieldValidator/PowermailValidator.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Classes/FieldValidator/PowermailValidator.php b/Classes/FieldValidator/PowermailValidator.php index e03853e..120e733 100644 --- a/Classes/FieldValidator/PowermailValidator.php +++ b/Classes/FieldValidator/PowermailValidator.php @@ -6,6 +6,7 @@ use In2code\Powermail\Domain\Validator\AbstractValidator; use StudioMitte\FriendlyCaptcha\Service\Api; +use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; class PowermailValidator extends AbstractValidator @@ -48,13 +49,18 @@ protected function isFormWithCaptchaField($mail): bool protected function isCaptchaCheckToSkip(): bool { if (property_exists($this, 'flexForm')) { - // @TODO: flexForm null in powermail v13 + $action = $this->getActionName(); $confirmationActive = $this->flexForm['settings']['flexform']['main']['confirmation'] === '1'; $optinActive = $this->flexForm['settings']['flexform']['main']['optin'] === '1'; + if ($action === 'create' && $confirmationActive || $action === 'checkCreate' && $confirmationActive) { + return true; + } - return $this->getActionName() === 'create' && $confirmationActive - || $this->getActionName() === 'optinConfirm' && $optinActive; + if ($action === 'optinConfirm' && $optinActive) { + return true; + } } + return false; } @@ -63,7 +69,9 @@ protected function isCaptchaCheckToSkip(): bool */ protected function getActionName(): string { - $pluginVariables = GeneralUtility::_GPmerged('tx_powermail_pi1'); + $request = $GLOBALS['TYPO3_REQUEST']; + $pluginVariables = $request->getQueryParams()['tx_powermail_pi1']; + ArrayUtility::mergeRecursiveWithOverrule($pluginVariables, $request->getParsedBody()['tx_powermail_pi1']); return $pluginVariables['action']; } } From d3f27d5bc0377c6241bc1697f02fb239a5741f1e Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Tue, 17 Dec 2024 08:13:02 +0100 Subject: [PATCH 07/10] Fix tests v13 --- Build/Scripts/runTests.sh | 75 +++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index d98f722..dce8bb6 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -45,8 +45,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.2" - if ! [[ ${DBMS_VERSION} =~ ^(10.2|10.3|10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1)$ ]]; then + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.3" + if ! [[ ${DBMS_VERSION} =~ ^(10.3|10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -61,8 +61,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="5.5" - if ! [[ ${DBMS_VERSION} =~ ^(5.5|5.6|5.7|8.0)$ ]]; then + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.0" + if ! [[ ${DBMS_VERSION} =~ ^(8.0)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -170,6 +170,7 @@ Options: - composerInstallHighest: "composer update", handy if host has no PHP - coveralls: Generate coverage - docsGenerate: Renders the extension ReST documentation. + - rector: Run rector - functional: functional tests - lint: PHP linting - unit: PHP unit tests @@ -200,8 +201,7 @@ Options: -i version Specify a specific database version With "-d mariadb": - - 10.2 short-term, maintained until 2023-05-25 (default) - - 10.3 short-term, maintained until 2023-05-25 + - 10.3 short-term, maintained until 2023-05-25 (default) - 10.4 short-term, maintained until 2024-06-18 - 10.5 short-term, maintained until 2025-06-24 - 10.6 long-term, maintained until 2026-06 @@ -213,10 +213,7 @@ Options: - 11.0 development series - 11.1 short-term development series With "-d mysql": - - 5.5 unmaintained since 2018-12 (default) - - 5.6 unmaintained since 2021-02 - - 5.7 maintained until 2023-10 - - 8.0 maintained until 2026-04 + - 8.0 maintained until 2026-04 (default) With "-d postgres": - 10 unmaintained since 2022-11-10 (default) - 11 unmaintained since 2023-11-09 @@ -226,19 +223,18 @@ Options: - 15 maintained until 2027-11-11 - 16 maintained until 2028-11-09 - -t <11|12> + -t <12|13> Only with -s composerInstall|composerInstallMin|composerInstallMax Specifies the TYPO3 CORE Version to be used - - 11.5: use TYPO3 v11 (default) - - 12.4: use TYPO3 v12 + - 12: use TYPO3 v12 (default) + - 13: use TYPO3 v13 - -p <7.4|8.0|8.1|8.2|8.3> + -p <8.1|8.2|8.3|8.4> Specifies the PHP minor version to be used - - 7.4: use PHP 7.4 (default) - - 8.0: use PHP 8.0 - - 8.1: use PHP 8.1 + - 8.1: use PHP 8.1 (default) - 8.2: use PHP 8.2 - 8.3: use PHP 8.3 + - 8.4: use PHP 8.4 -e "" Only with -s docsGenerate|functional|unit @@ -275,7 +271,7 @@ Options: Show this help. Examples: - # Run all core unit tests using PHP 7.4 + # Run all core unit tests ./Build/Scripts/runTests.sh -s unit # Run all core units tests and enable xdebug (have a PhpStorm listening on port 9003!) @@ -311,23 +307,23 @@ ROOT_DIR="${PWD}" # Option defaults TEST_SUITE="" -TYPO3_VERSION="11" +TYPO3_VERSION="12" DBMS="sqlite" DBMS_VERSION="" -PHP_VERSION="7.4" +PHP_VERSION="8.1" PHP_XDEBUG_ON=0 PHP_XDEBUG_PORT=9003 EXTRA_TEST_OPTIONS="" -CGLCHECK_DRY_RUN=0 +DRY_RUN=0 DATABASE_DRIVER="" CONTAINER_BIN="" -COMPOSER_ROOT_VERSION="11.4.3-dev" +COMPOSER_ROOT_VERSION="12.0.0-dev" CONTAINER_INTERACTIVE="-it --init" HOST_UID=$(id -u) HOST_PID=$(id -g) USERSET="" SUFFIX=$(echo $RANDOM) -NETWORK="friendsoftypo3-tea-${SUFFIX}" +NETWORK="georgringer-news-${SUFFIX}" CI_PARAMS="${CI_PARAMS:-}" CONTAINER_HOST="host.docker.internal" PHPSTAN_CONFIG_FILE="phpstan.neon" @@ -361,7 +357,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3|8.4)$ ]]; then INVALID_OPTIONS+=("-p ${OPTARG}") fi ;; @@ -370,7 +366,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; t) TYPO3_VERSION=${OPTARG} - if ! [[ ${TYPO3_VERSION} =~ ^(11|12)$ ]]; then + if ! [[ ${TYPO3_VERSION} =~ ^(12|13)$ ]]; then INVALID_OPTIONS+=("-t ${OPTARG}") fi ;; @@ -381,7 +377,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do PHP_XDEBUG_PORT=${OPTARG} ;; n) - CGLCHECK_DRY_RUN=1 + DRY_RUN=1 ;; h) loadHelp @@ -474,7 +470,7 @@ fi case ${TEST_SUITE} in cgl) DRY_RUN_OPTIONS='' - if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then + if [ "${DRY_RUN}" -eq 1 ]; then DRY_RUN_OPTIONS='--dry-run --diff' fi COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v ${DRY_RUN_OPTIONS} --config=Build/php-cs-fixer/php-cs-fixer.php --using-cache=no" @@ -508,14 +504,14 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-highest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c " - if [ ${TYPO3_VERSION} -eq 11 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi if [ ${TYPO3_VERSION} -eq 12 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ typo3/cms-core:^12.4.2 || exit 1 fi + if [ ${TYPO3_VERSION} -eq 13 ]; then + composer require --no-ansi --no-interaction --no-progress --no-install \ + typo3/cms-core:^13.1 || exit 1 + fi composer update --no-progress --no-interaction || exit 1 composer show || exit 1 " @@ -526,14 +522,14 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-lowest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c " - if [ ${TYPO3_VERSION} -eq 11 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi if [ ${TYPO3_VERSION} -eq 12 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ typo3/cms-core:^12.4.2 || exit 1 fi + if [ ${TYPO3_VERSION} -eq 13 ]; then + composer require --no-ansi --no-interaction --no-progress --no-install \ + typo3/cms-core:^13.1 || exit 1 + fi composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest || exit 1 composer show || exit 1 " @@ -592,6 +588,15 @@ case ${TEST_SUITE} in ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c "${COMMAND}" SUITE_EXIT_CODE=$? ;; + rector) + DRY_RUN_OPTIONS='' + if [ "${DRY_RUN}" -eq 1 ]; then + DRY_RUN_OPTIONS='--dry-run' + fi + COMMAND="php -dxdebug.mode=off .Build/bin/rector process ${DRY_RUN_OPTIONS} --config=Build/rector/rector.php --no-progress-bar --ansi" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + SUITE_EXIT_CODE=$? + ;; unit) COMMAND=(.Build/bin/phpunit -c Build/phpunit/UnitTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} "$@") ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} "${COMMAND[@]}" From 67190aff578583851da4dd933a42b56b286af64e Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Tue, 17 Dec 2024 08:19:38 +0100 Subject: [PATCH 08/10] Resolve dev dependencies conflicts --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c85ddfc..3102131 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,12 @@ }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", - "typo3/testing-framework": "^7.0.1", "typo3/cms-form": "^12.4.5 || ^13.4", - "phpunit/phpunit": "^9", + "phpunit/phpunit": "^11", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", - "webmozart/assert": "^1.11.0" + "webmozart/assert": "^1.11.0", + "typo3/testing-framework": "^8.2 || 9.1" }, "suggest": { "in2code/powermail": "Support for EXT:powermail", From 6b836ed384ea6f21831570fc895c7a2f32a154a3 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Tue, 17 Dec 2024 08:22:05 +0100 Subject: [PATCH 09/10] Revert last commit - fix pipeline --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3102131..c85ddfc 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,12 @@ }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", + "typo3/testing-framework": "^7.0.1", "typo3/cms-form": "^12.4.5 || ^13.4", - "phpunit/phpunit": "^11", + "phpunit/phpunit": "^9", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", - "webmozart/assert": "^1.11.0", - "typo3/testing-framework": "^8.2 || 9.1" + "webmozart/assert": "^1.11.0" }, "suggest": { "in2code/powermail": "Support for EXT:powermail", From 8e94f99a40779749ffaa77c8228699e8387f3579 Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Tue, 17 Dec 2024 08:25:04 +0100 Subject: [PATCH 10/10] Resolve dev dependencies conflicts --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c85ddfc..2dab7f9 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,12 @@ }, "require-dev": { "typo3/cms-composer-installers": "^3.1.3 || 4.0.0-RC1 || ^5.0", - "typo3/testing-framework": "^7.0.1", "typo3/cms-form": "^12.4.5 || ^13.4", - "phpunit/phpunit": "^9", + "phpunit/phpunit": "^10", "typo3/coding-standards": "^0.5.3", "friendsofphp/php-cs-fixer": "^3.51.0", - "webmozart/assert": "^1.11.0" + "webmozart/assert": "^1.11.0", + "typo3/testing-framework": "^8.2" }, "suggest": { "in2code/powermail": "Support for EXT:powermail",