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 5e44c71 commit a77905d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Tests/Functional/Resource/Fixtures/DirtySVG/external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tests/Functional/Resource/Fixtures/DirtySVG/svgOne.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tests/Functional/Resource/Fixtures/DirtySVG/xlinkLoop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Tests/Functional/Resource/Security/SvgSanitizerTest.php
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 a77905d

Please sign in to comment.