From ac6a686c4b8d01d4a4d063d65884cbfd94c41dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech> Date: Mon, 3 Jul 2023 14:23:29 +0200 Subject: [PATCH] [TASK] Run unit tests with PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: #101478 Releases: main, 12.4, 11.5 Change-Id: I40987e100686771365c30652dba5a13bfd509604 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80206 Reviewed-by: Stefan B�rk <stefan@buerk.tech> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: core-ci <typo3@b13.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Stefan B�rk <stefan@buerk.tech> --- Build/gitlab-ci/nightly/unit.yml | 99 +++++++++++++++++++ Build/gitlab-ci/pre-merge/unit.yml | 19 ++++ .../Unit/Utility/LocalizationUtilityTest.php | 14 +-- 3 files changed, 125 insertions(+), 7 deletions(-) diff --git a/Build/gitlab-ci/nightly/unit.yml b/Build/gitlab-ci/nightly/unit.yml index 842385bd45d0..1255c18e1e25 100644 --- a/Build/gitlab-ci/nightly/unit.yml +++ b/Build/gitlab-ci/nightly/unit.yml @@ -406,3 +406,102 @@ unit php 8.2 min random: script: - Build/Scripts/runTests.sh -s composerInstallMin -p 8.2 - Build/Scripts/runTests.sh -s unitRandom -p 8.2 + +unit php 8.3 locked: + stage: unit + needs: [] + only: + - schedules + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.3 + - Build/Scripts/runTests.sh -s unit -p 8.3 +unit php 8.3 locked deprecated: + stage: unit + needs: [] + only: + - schedules + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.3 + - Build/Scripts/runTests.sh -s unitDeprecated -p 8.3 +unit php 8.3 locked random: + stage: unit + needs: [] + only: + - schedules + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.3 + - Build/Scripts/runTests.sh -s unitRandom -p 8.3 + +unit php 8.3 max: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-max + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMax -p 8.3 + - Build/Scripts/runTests.sh -s unit -p 8.3 +unit php 8.3 max deprecated: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-max + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMax -p 8.3 + - Build/Scripts/runTests.sh -s unitDeprecated -p 8.3 +unit php 8.3 max random: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-max + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMax -p 8.3 + - Build/Scripts/runTests.sh -s unitRandom -p 8.3 + +unit php 8.3 min: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-min + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMin -p 8.3 + - Build/Scripts/runTests.sh -s unit -p 8.3 +unit php 8.3 min deprecated: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-min + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMin -p 8.3 + - Build/Scripts/runTests.sh -s unitDeprecated -p 8.3 +unit php 8.3 min random: + stage: unit + needs: [] + only: + - schedules + cache: + key: 11.5-composer-min + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstallMin -p 8.3 + - Build/Scripts/runTests.sh -s unitRandom -p 8.3 diff --git a/Build/gitlab-ci/pre-merge/unit.yml b/Build/gitlab-ci/pre-merge/unit.yml index bbb4effee4da..e8302c48e315 100644 --- a/Build/gitlab-ci/pre-merge/unit.yml +++ b/Build/gitlab-ci/pre-merge/unit.yml @@ -86,3 +86,22 @@ unit php 8.2 deprecated pre-merge: script: - Build/Scripts/runTests.sh -s composerInstall -p 8.2 - Build/Scripts/runTests.sh -s unitDeprecated -p 8.2 + +unit php 8.3 pre-merge: + stage: main + except: + refs: + - schedules + - "11.5" + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.3 + - Build/Scripts/runTests.sh -s unit -p 8.3 +unit php 8.3 deprecated pre-merge: + stage: main + except: + refs: + - schedules + - "11.5" + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.3 + - Build/Scripts/runTests.sh -s unitDeprecated -p 8.3 diff --git a/typo3/sysext/extbase/Tests/Unit/Utility/LocalizationUtilityTest.php b/typo3/sysext/extbase/Tests/Unit/Utility/LocalizationUtilityTest.php index 2ec90d60b30f..17116fe0fc5b 100644 --- a/typo3/sysext/extbase/Tests/Unit/Utility/LocalizationUtilityTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Utility/LocalizationUtilityTest.php @@ -194,7 +194,7 @@ class LocalizationUtilityTest extends UnitTestCase $this->configurationManagerInterfaceProphecy = $this->prophesize(ConfigurationManagerInterface::class); $property = $reflectionClass->getProperty('configurationManager'); $property->setAccessible(true); - $property->setValue($this->configurationManagerInterfaceProphecy->reveal()); + $property->setValue(null, $this->configurationManagerInterfaceProphecy->reveal()); $localizationFactoryProphecy = $this->prophesize(LocalizationFactory::class); GeneralUtility::setSingletonInstance(LocalizationFactory::class, $localizationFactoryProphecy->reveal()); @@ -210,11 +210,11 @@ class LocalizationUtilityTest extends UnitTestCase $property = $reflectionClass->getProperty('configurationManager'); $property->setAccessible(true); - $property->setValue(null); + $property->setValue(null, null); $property = $reflectionClass->getProperty('LOCAL_LANG'); $property->setAccessible(true); - $property->setValue([]); + $property->setValue(null, []); GeneralUtility::purgeInstances(); @@ -337,7 +337,7 @@ class LocalizationUtilityTest extends UnitTestCase $property = $reflectionClass->getProperty('LOCAL_LANG'); $property->setAccessible(true); - $property->setValue($this->LOCAL_LANG); + $property->setValue(null, $this->LOCAL_LANG); $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class); $backendUserAuthentication = $backendUserAuthenticationProphecy->reveal(); @@ -370,7 +370,7 @@ class LocalizationUtilityTest extends UnitTestCase $property = $reflectionClass->getProperty('LOCAL_LANG'); $property->setAccessible(true); - $property->setValue($this->LOCAL_LANG); + $property->setValue(null, $this->LOCAL_LANG); $cacheManagerProphecy = $this->prophesize(CacheManager::class); $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class); $cacheManagerProphecy->getCache('l10n')->willReturn($cacheFrontendProphecy->reveal()); @@ -488,7 +488,7 @@ class LocalizationUtilityTest extends UnitTestCase $property = $reflectionClass->getProperty('LOCAL_LANG'); $property->setAccessible(true); - $property->setValue($LOCAL_LANG); + $property->setValue(null, $LOCAL_LANG); $configurationType = ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK; $this->configurationManagerInterfaceProphecy @@ -517,7 +517,7 @@ class LocalizationUtilityTest extends UnitTestCase $property = $reflectionClass->getProperty('LOCAL_LANG'); $property->setAccessible(true); - $property->setValue($this->LOCAL_LANG); + $property->setValue(null, $this->LOCAL_LANG); $typoScriptLocalLang = [ '_LOCAL_LANG' => [ -- GitLab