Skip to content

Commit

Permalink
[TASK] Have PHP 8.4 functionals
Browse files Browse the repository at this point in the history
Activate PHP 8.4 functional tests in pre-merge
and a nightly combination.

Similar to unit tests with #104578, we patch
another library: enshrined/svg-sanitize. A
patch is pending [1], but not yet merged nor
released. Codewise its trivial.

Some tests need a minor adaption since XML
files are created slightly differently with
PHP 8.4, the change aligns the fixtures to
deal with this.

[1] darylldoyle/svg-sanitizer#110

Resolves: #104604
Related: #104578
Releases: main
Change-Id: I5d99275aa14d56c35894b270a7f111a50fd56ab7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85592
Reviewed-by: Garvin Hicking <gh@faktor-e.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Garvin Hicking <gh@faktor-e.de>
  • Loading branch information
lolli42 committed Aug 12, 2024
1 parent d826b08 commit bee30ea
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Build/gitlab-ci/nightly/functional.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
functional mariadb 10.10 php 8.3 max:
functional mariadb 10.10 php 8.4 max:
stage: functional
tags:
- metal2
Expand All @@ -7,8 +7,8 @@ functional mariadb 10.10 php 8.3 max:
- schedules
parallel: 6
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.3
- Build/Scripts/runTests.sh -s functional -d mariadb -i 10.10 -p 8.3 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.4
- Build/Scripts/runTests.sh -s functional -d mariadb -i 10.10 -p 8.4 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
functional mariadb 10.4 php 8.2 min:
stage: functional
tags:
Expand Down
6 changes: 3 additions & 3 deletions Build/gitlab-ci/pre-merge/functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ functional mariadb 10.4 php 8.3 pre-merge:
- Build/Scripts/runTests.sh -s composerInstall -p 8.3
- Build/Scripts/runTests.sh -s functional -d mariadb -i 10.4 -p 8.3 -c $CI_NODE_INDEX/$CI_NODE_TOTAL

functional postgres 10 php 8.2 pre-merge:
functional postgres 10 php 8.4 pre-merge:
stage: main
tags:
- metal2
Expand All @@ -21,8 +21,8 @@ functional postgres 10 php 8.2 pre-merge:
- main
parallel: 10
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.2
- Build/Scripts/runTests.sh -s functional -d postgres -i 10 -p 8.2 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
- Build/Scripts/runTests.sh -s composerInstall -p 8.4
- Build/Scripts/runTests.sh -s functional -d postgres -i 10 -p 8.4 -c $CI_NODE_INDEX/$CI_NODE_TOTAL

functional sqlite php 8.2 pre-merge:
stage: main
Expand Down
13 changes: 13 additions & 0 deletions Build/patches/darylldoyle-svg-sanitizer-php-8.4.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Exceptions/NestingException.php b/src/Exceptions/NestingException.php
index 474b987..7acc842 100644
--- a/src/Exceptions/NestingException.php
+++ b/src/Exceptions/NestingException.php
@@ -18,7 +18,7 @@ class NestingException extends \Exception
* @param Exception|null $previous
* @param \DOMElement|null $element
*/
- public function __construct($message = "", $code = 0, Exception $previous = null, \DOMElement $element = null)
+ public function __construct($message = "", $code = 0, ?Exception $previous = null, ?\DOMElement $element = null)
{
$this->element = $element;
parent::__construct($message, $code, $previous);
3 changes: 3 additions & 0 deletions Build/patches/patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"patches": {
"firebase/php-jwt": {
"firebase/php-jwt PHP 8.4": "Build/patches/firebase-php-jwt-572-php-8.4.diff"
},
"enshrined/svg-sanitize": {
"darylldoyle/svg-sanitize PHP 8.4": "Build/patches/darylldoyle-svg-sanitizer-php-8.4.diff"
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public static function svgContentIsSanitizedDataProvider(): array
public function svgContentIsSanitized(string $filePath, string $sanitizedFilePath): void
{
$sanitizer = new SvgSanitizer();
self::assertStringEqualsFile(
$sanitizedFilePath,
$sanitizer->sanitizeContent(file_get_contents($filePath))
);
$sanitizedFileContent = file_get_contents($sanitizedFilePath);
// Align lowercase / uppercase "UTF-8" in files - Casing changed in PHP 8.4 generated XML.
$sanitizedFileContent = str_replace('utf-8', 'UTF-8', $sanitizedFileContent);
self::assertEquals($sanitizedFileContent, $sanitizer->sanitizeContent(file_get_contents($filePath)));
}
}

0 comments on commit bee30ea

Please sign in to comment.