diff --git a/Build/phpstan/Core12/phpstan-baseline.neon b/Build/phpstan/Core12/phpstan-baseline.neon index 1b117626..1a3590c5 100644 --- a/Build/phpstan/Core12/phpstan-baseline.neon +++ b/Build/phpstan/Core12/phpstan-baseline.neon @@ -260,11 +260,6 @@ parameters: count: 1 path: ../../../Tests/Functional/Hooks/TranslateHookTest.php - - - message: "#^Parameter \\#1 \\$current of method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Hooks\\\\TranslateHookTest\\:\\:mergeInstruction\\(\\) expects TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction, TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction\\|null given\\.$#" - count: 1 - path: ../../../Tests/Functional/Hooks/TranslateHookTest.php - - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\GlossaryRegressionTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -315,11 +310,6 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/GlossaryRegressionTest.php - - - message: "#^Parameter \\#1 \\$current of method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\GlossaryRegressionTest\\:\\:mergeInstruction\\(\\) expects TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction, TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction\\|null given\\.$#" - count: 1 - path: ../../../Tests/Functional/Regression/GlossaryRegressionTest.php - - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\LocalizationInlineRegressionTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -370,11 +360,6 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php - - - message: "#^Parameter \\#1 \\$current of method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\LocalizationInlineRegressionTest\\:\\:mergeInstruction\\(\\) expects TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction, TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction\\|null given\\.$#" - count: 1 - path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php - - message: "#^Cannot access property \\$code on DeepL\\\\Language\\|null\\.$#" count: 7 @@ -430,11 +415,6 @@ parameters: count: 1 path: ../../../Tests/Functional/Services/LanguageServiceTest.php - - - message: "#^Parameter \\#1 \\$current of method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Services\\\\LanguageServiceTest\\:\\:mergeInstruction\\(\\) expects TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction, TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction\\|null given\\.$#" - count: 1 - path: ../../../Tests/Functional/Services/LanguageServiceTest.php - - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -484,8 +464,3 @@ parameters: message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:writeSiteConfiguration\\(\\) has parameter \\$site with no value type specified in iterable type array\\.$#" count: 1 path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php - - - - message: "#^Parameter \\#1 \\$current of method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:mergeInstruction\\(\\) expects TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction, TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\Framework\\\\Frontend\\\\Internal\\\\AbstractInstruction\\|null given\\.$#" - count: 1 - path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php diff --git a/Tests/Functional/Fixtures/Traits/SiteBasedTestTrait.php b/Tests/Functional/Fixtures/Traits/SiteBasedTestTrait.php index 55b541de..6f5ef39d 100644 --- a/Tests/Functional/Fixtures/Traits/SiteBasedTestTrait.php +++ b/Tests/Functional/Fixtures/Traits/SiteBasedTestTrait.php @@ -8,8 +8,8 @@ use TYPO3\CMS\Core\Configuration\SiteConfiguration; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\AbstractInstruction; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\ArrayValueInstruction; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\InstructionInterface; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\TypoScriptInstruction; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use WebVision\Deepltranslate\Core\Tests\Functional\Fixtures\Frontend\PhpError; @@ -242,13 +242,13 @@ protected function resolveLanguagePreset(string $identifier) /** * @todo Instruction handling should be part of Testing Framework (multiple instructions per identifier, merge in interface) */ - protected function applyInstructions(InternalRequest $request, AbstractInstruction ...$instructions): InternalRequest + protected function applyInstructions(InternalRequest $request, InstructionInterface ...$instructions): InternalRequest { $modifiedInstructions = []; - + $instructions = array_filter($instructions); foreach ($instructions as $instruction) { $identifier = $instruction->getIdentifier(); - if (isset($modifiedInstructions[$identifier]) || $request->getInstruction($identifier) !== null) { + if (($modifiedInstructions[$identifier] ?? $request->getInstruction($identifier)) !== null) { $modifiedInstructions[$identifier] = $this->mergeInstruction( $modifiedInstructions[$identifier] ?? $request->getInstruction($identifier), $instruction @@ -261,7 +261,7 @@ protected function applyInstructions(InternalRequest $request, AbstractInstructi return $request->withInstructions($modifiedInstructions); } - protected function mergeInstruction(AbstractInstruction $current, AbstractInstruction $other): AbstractInstruction + protected function mergeInstruction(InstructionInterface $current, InstructionInterface $other): InstructionInterface { if (get_class($current) !== get_class($other)) { throw new LogicException('Cannot merge different instruction types', 1565863174); diff --git a/composer.json b/composer.json index f8b13ee1..4ad581f0 100644 --- a/composer.json +++ b/composer.json @@ -108,7 +108,7 @@ "typo3/cms-rte-ckeditor": "^12.4.2", "typo3/cms-tstemplate": "^12.4.2", "typo3/cms-workspaces": "^12.4.2", - "typo3/testing-framework": "^7.1.1" + "typo3/testing-framework": "^8.2.7" }, "suggest": { "b13/container": "Just to be loaded after EXT:container",