Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Cleanup removed TYPO3 v11 support #383

Merged
merged 16 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,7 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
;;
functional)
PHPUNIT_CONFIG_FILE="Build/phpunit/FunctionalTests-10.xml"
# @todo Remove version switch after TYPO3 v11 / phpunit 9 support has been dropped.
[[ "${CORE_VERSION}" -eq 11 ]] && PHPUNIT_CONFIG_FILE="Build/phpunit/FunctionalTests.xml"
PHPUNIT_CONFIG_FILE="Build/phpunit/FunctionalTests.xml"
COMMAND=(.Build/bin/phpunit -c ${PHPUNIT_CONFIG_FILE} --exclude-group not-${DBMS} "$@")
echo "Using deepl-mockserver"
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name deepl-func-${SUFFIX} --network ${NETWORK} -d ${IMAGE_DEEPL} >/dev/null
Expand Down Expand Up @@ -570,15 +568,6 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
;;
lintTypoScript)
# @todo Remove this after a working version for lower php has been released OR minimum PHP version raised.
# @see https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-96812-OverrideBackendTemplatesWithTSconfig.html
if [ "${PHP_VERSION}" == "7.4" -o "${PHP_VERSION}" == "7.4" ]; then
echo " ERROR: Wrong php version ${PHP_VERSION}"
echo " -t -s lintTypoScript requires to be executed at least with PHP8.1 with a proper"
echo " -t -s composerUpdate run before to retrieve a linter version which can deal with"
echo " TYPO3 v12 PageTSConfig backend template override syntax"
exit 1
fi
COMMAND="php -dxdebug.mode=off .Build/bin/typoscript-lint --ansi --config=./Build/typoscript-lint/typoscript-lint.yml"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name lint-php-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
Expand All @@ -600,17 +589,13 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
;;
unit)
PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests-10.xml"
# @todo Remove version switch after TYPO3 v11 / phpunit 9 support has been dropped.
[[ "${CORE_VERSION}" -eq 11 ]] && PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests.xml"
PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests.xml"
COMMAND=(.Build/bin/phpunit -c ${PHPUNIT_CONFIG_FILE} "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} "${COMMAND[@]}"
SUITE_EXIT_CODE=$?
;;
unitRandom)
PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests-10.xml"
# @todo Remove version switch after TYPO3 v11 / phpunit 9 support has been dropped.
[[ "${CORE_VERSION}" -eq 11 ]] && PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests.xml"
PHPUNIT_CONFIG_FILE="Build/phpunit/UnitTests.xml"
COMMAND=(.Build/bin/phpunit -c ${PHPUNIT_CONFIG_FILE} --order-by=random ${PHPUNIT_RANDOM} "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-random-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} "${COMMAND[@]}"
SUITE_EXIT_CODE=$?
Expand Down
6 changes: 3 additions & 3 deletions Build/Scripts/validateRstFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(string $dir = '')
}
}

public function validate()
public function validate(): void
{
printf('Searching for rst snippets in ' . $this->baseDir . chr(10));

Expand Down Expand Up @@ -171,14 +171,14 @@ protected function validateContent(string $fileContent)
$this->validateLinkTarget($fileContent);
}

private function setError(array $config)
private function setError(array $config): void
{
$this->messages[$config['type']]['title'] = $config['title'];
$this->messages[$config['type']]['message'] = $config['message'];
$this->isError = true;
}

private function validateLinkTarget(string $fileContent)
private function validateLinkTarget(string $fileContent): void
{
$linkTargetConfig = [
'type' => 'linktarget',
Expand Down
10 changes: 0 additions & 10 deletions Build/phpstan/Core12/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ parameters:
count: 1
path: ../../../Classes/Event/Listener/GlossarySyncButtonProvider.php

-
message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Form\\\\Item\\\\SiteConfigSupportedLanguageItemsProcFunc\\:\\:getSupportedLanguageForField\\(\\) has no return type specified\\.$#"
count: 1
path: ../../../Classes/Form/Item/SiteConfigSupportedLanguageItemsProcFunc.php

-
message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Form\\\\Item\\\\SiteConfigSupportedLanguageItemsProcFunc\\:\\:getSupportedLanguageForField\\(\\) has parameter \\$configuration with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -95,11 +90,6 @@ parameters:
count: 1
path: ../../../Classes/Hooks/Glossary/UpdatedGlossaryEntryTermHook.php

-
message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Hooks\\\\TCEmainHook\\:\\:checkModifyAccessList\\(\\) has no return type specified\\.$#"
count: 1
path: ../../../Classes/Hooks/TCEmainHook.php

-
message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Override\\\\Core12\\\\DatabaseRecordList\\:\\:makeLocalizationPanel\\(\\) has parameter \\$translations with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
59 changes: 0 additions & 59 deletions Build/phpunit/FunctionalTests-10.xml

This file was deleted.

45 changes: 21 additions & 24 deletions Build/phpunit/FunctionalTests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,46 @@
TYPO3 CMS functional test suite also needs phpunit bootstrap code, the
file is located next to this .xml as FunctionalTestsBootstrap.php

phpunit v9 compatible version, use -10.xml file for phpunit 10.
phpunit v10.1 compatible version.
-->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
backupGlobals="true"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="FunctionalTestsBootstrap.php"
cacheDirectory=".phpunit.cache"
cacheResult="false"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnNotice="true"
failOnRisky="true"
failOnWarning="true"
requireCoverageMetadata="false"
>
<testsuites>
<testsuite name="Functional tests">
<!--
This path either needs an adaption in extensions, or an extension's
test location path needs to be given to phpunit.
-->
This path either needs an adaption in extensions, or an extension's
test location path needs to be given to phpunit.
-->
<directory suffix="Test.php">../../Tests/Functional/</directory>
</testsuite>
</testsuites>
<php>
<!-- @deprecated: will be removed with next major version, constant TYPO3_MODE is deprecated -->
<const name="TYPO3_MODE" value="BE"/>
<!--
@deprecated: Set this to not suppress warnings, notices and deprecations in functional tests
with TYPO3 core v11 and up.
Will always be done with next major version.
To still suppress warnings, notices and deprecations, do NOT define the constant at all.
-->
<const name="TYPO3_TESTING_FUNCTIONAL_REMOVE_ERROR_HANDLER"
value="true"/>
@deprecated: Set this to not suppress warnings, notices and deprecations in functional tests
with TYPO3 core v11 and up.
Will always be done with next major version.
To still suppress warnings, notices and deprecations, do NOT define the constant at all.
-->
<const name="TYPO3_TESTING_FUNCTIONAL_REMOVE_ERROR_HANDLER" value="true"/>
<ini name="display_errors" value="1"/>
<env name="TYPO3_CONTEXT" value="Testing"/>
</php>
Expand Down
52 changes: 0 additions & 52 deletions Build/phpunit/UnitTests-10.xml

This file was deleted.

51 changes: 24 additions & 27 deletions Build/phpunit/UnitTests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,40 @@
TYPO3 CMS functional test suite also needs phpunit bootstrap code, the
file is located next to this .xml as FunctionalTestsBootstrap.php

phpunit v9 compatible version, use -10.xml file for phpunit 10.
phpunit v10.1 compatible version.
-->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
backupGlobals="true"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="UnitTestsBootstrap.php"
cacheDirectory=".phpunit.cache"
cacheResult="false"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnNotice="true"
failOnRisky="true"
failOnWarning="true"
requireCoverageMetadata="false"
>
<testsuites>
<testsuite name="Unit tests">
<!--
<testsuites>
<testsuite name="Unit tests">
<!--
This path either needs an adaption in extensions, or an extension's
test location path needs to be given to phpunit.
-->
<directory suffix="Test.php">../../Tests/Unit/</directory>
</testsuite>
</testsuites>
<php>
<!-- @deprecated: will be removed with next major version, constant TYPO3_MODE is deprecated -->
<const name="TYPO3_MODE" value="BE"/>
<ini name="display_errors" value="1"/>
<env name="TYPO3_CONTEXT" value="Testing"/>
</php>
<directory suffix="Test.php">../../Tests/Unit/</directory>
</testsuite>
</testsuites>
<php>
<!-- @deprecated: will be removed with next major version, constant TYPO3_MODE is deprecated -->
<const name="TYPO3_MODE" value="BE"/>
<ini name="display_errors" value="1"/>
<env name="TYPO3_CONTEXT" value="Testing"/>
</php>
</phpunit>
10 changes: 5 additions & 5 deletions Classes/Controller/GlossarySyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function update(ServerRequestInterface $request): RedirectResponse
sprintf('Page "%d" not configured for glossary synchronization.', $pages['uid']),
(string)LocalizationUtility::translate(
'glossary.sync.title.invalid',
'deepltranslate_core'
'DeepltranslateCore'
),
2,
true
Expand All @@ -69,15 +69,15 @@ public function update(ServerRequestInterface $request): RedirectResponse
try {
$this->deeplGlossaryService->syncGlossaries((int)$processingParameters['uid']);
$this->flashMessageService->getMessageQueueByIdentifier()->enqueue(new FlashMessage(
(string)LocalizationUtility::translate('glossary.sync.message', 'deepltranslate_core'),
(string)LocalizationUtility::translate('glossary.sync.title', 'deepltranslate_core'),
(string)LocalizationUtility::translate('glossary.sync.message', 'DeepltranslateCore'),
(string)LocalizationUtility::translate('glossary.sync.title', 'DeepltranslateCore'),
0, // OK
true
));
} catch (FailedToCreateGlossaryException $exception) {
$this->flashMessageService->getMessageQueueByIdentifier()->enqueue(new FlashMessage(
(string)LocalizationUtility::translate('glossary.sync.message.invalid', 'deepltranslate_core'),
(string)LocalizationUtility::translate('glossary.sync.title.invalid', 'deepltranslate_core'),
(string)LocalizationUtility::translate('glossary.sync.message.invalid', 'DeepltranslateCore'),
(string)LocalizationUtility::translate('glossary.sync.title.invalid', 'DeepltranslateCore'),
2, // Error
true
));
Expand Down
2 changes: 1 addition & 1 deletion Classes/Event/Listener/GlossarySyncButtonProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __invoke(ModifyButtonBarEvent $event): void
$parameters = $this->buildParamsArrayForListView((int)$id);
$title = (string)LocalizationUtility::translate(
'glossary.sync.button.all',
'deepltranslate_core'
'DeepltranslateCore'
);
// Style button
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
$this->deeplService = $deeplService;
}

public function getSupportedLanguageForField(array &$configuration)
public function getSupportedLanguageForField(array &$configuration): void
{
$supportedLanguages = $this->deeplService->getSupportLanguage()['target'];

Expand Down
Loading