From ea23f7814e98ccb1cac82d5103e879cd4f54087d Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon@praetorius.me>
Date: Mon, 4 Mar 2024 13:06:32 +0100
Subject: [PATCH] [TASK] Use more Fluid Standalone ViewHelpers

With Fluid 2.10.0, which is a required dependency, ViewHelpers from
TYPO3 without any TYPO3 dependency have been extracted to Fluid
Standalone. This patch removes the now duplicate ViewHelpers from
TYPO3.

This patch is non-breaking since:

* The affected ViewHelpers are final classes
* The global f: namespace falls back already to ViewHelpers from
Fluid Standalone

Resolves: #103265
Releases: main
Change-Id: Ib17c2d9f0cae045e809065e63551e0d0d6396cc8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83192
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Benni Mack <benni@typo3.org>
---
 .../ViewHelpers/Format/CaseViewHelper.php     | 159 ------------------
 .../ViewHelpers/Format/JsonViewHelper.php     | 103 ------------
 .../ViewHelpers/Format/Nl2brViewHelper.php    |  75 ---------
 .../ViewHelpers/Format/NumberViewHelper.php   |  80 ---------
 .../Format/StripTagsViewHelper.php            | 121 -------------
 .../ViewHelpers/Format/TrimViewHelper.php     | 134 ---------------
 .../Format/UrlencodeViewHelper.php            |  91 ----------
 .../ViewHelpers/Format/CaseViewHelperTest.php | 103 ------------
 .../Format/Nl2brViewHelperTest.php            |  56 ------
 .../Format/NumberViewHelperTest.php           |  64 -------
 .../Format/StripTagsViewHelperTest.php        |  88 ----------
 .../ViewHelpers/Format/TrimViewHelperTest.php | 121 -------------
 .../Format/UrlencodeViewHelperTest.php        |  80 ---------
 13 files changed, 1275 deletions(-)
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/JsonViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/TrimViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/CaseViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/Nl2brViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/NumberViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/StripTagsViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/TrimViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/UrlencodeViewHelperTest.php

diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
deleted file mode 100644
index 199e7c87cfd8..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * Modifies the case of an input string to upper- or lowercase or capitalization.
- * The default transformation will be uppercase as in `mb_convert_case`_.
- *
- * Possible modes are:
- *
- * ``lower``
- *   Transforms the input string to its lowercase representation
- *
- * ``upper``
- *   Transforms the input string to its uppercase representation
- *
- * ``capital``
- *   Transforms the input string to its first letter upper-cased, i.e. capitalization
- *
- * ``uncapital``
- *   Transforms the input string to its first letter lower-cased, i.e. uncapitalization
- *
- * ``capitalWords``
- *   Transforms the input string to each containing word being capitalized
- *
- * Note that the behavior will be the same as in the appropriate PHP function `mb_convert_case`_;
- * especially regarding locale and multibyte behavior.
- *
- * .. _mb_convert_case: https://www.php.net/manual/function.mb-convert-case.php
- *
- * Examples
- * ========
- *
- * Default
- * -------
- *
- * ::
- *
- *    <f:format.case>Some Text with miXed case</f:format.case>
- *
- * Output::
- *
- *    SOME TEXT WITH MIXED CASE
- *
- * Example with given mode
- * -----------------------
- *
- * ::
- *
- *    <f:format.case mode="capital">someString</f:format.case>
- *
- * Output::
- *
- *    SomeString
- */
-final class CaseViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Directs the input string being converted to "lowercase"
-     */
-    public const CASE_LOWER = 'lower';
-
-    /**
-     * Directs the input string being converted to "UPPERCASE"
-     */
-    public const CASE_UPPER = 'upper';
-
-    /**
-     * Directs the input string being converted to "Capital case"
-     */
-    public const CASE_CAPITAL = 'capital';
-
-    /**
-     * Directs the input string being converted to "unCapital case"
-     */
-    public const CASE_UNCAPITAL = 'uncapital';
-
-    /**
-     * Directs the input string being converted to "Capital Case For Each Word"
-     */
-    public const CASE_CAPITAL_WORDS = 'capitalWords';
-
-    /**
-     * Output is escaped already. We must not escape children, to avoid double encoding.
-     *
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used.', false);
-        $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\' CASE_* constants. Defaults to uppercase application.', false, self::CASE_UPPER);
-    }
-
-    /**
-     * Changes the case of the input string
-     * @throws Exception
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
-    {
-        $value = $arguments['value'];
-        $mode = $arguments['mode'];
-
-        if ($value === null) {
-            $value = (string)$renderChildrenClosure();
-        }
-
-        switch ($mode) {
-            case self::CASE_LOWER:
-                $output = mb_strtolower($value, 'utf-8');
-                break;
-            case self::CASE_UPPER:
-                $output = mb_strtoupper($value, 'utf-8');
-                break;
-            case self::CASE_CAPITAL:
-                $firstChar = mb_substr($value, 0, 1, 'utf-8');
-                $firstChar = mb_strtoupper($firstChar, 'utf-8');
-                $remainder = mb_substr($value, 1, null, 'utf-8');
-                $output = $firstChar . $remainder;
-                break;
-            case self::CASE_UNCAPITAL:
-                $firstChar = mb_substr($value, 0, 1, 'utf-8');
-                $firstChar = mb_strtolower($firstChar, 'utf-8');
-                $remainder = mb_substr($value, 1, null, 'utf-8');
-                $output = $firstChar . $remainder;
-                break;
-            case self::CASE_CAPITAL_WORDS:
-                $output = mb_convert_case($value, MB_CASE_TITLE, 'utf-8');
-                break;
-            default:
-                throw new Exception('The case mode "' . $mode . '" supplied to Fluid\'s format.case ViewHelper is not supported.', 1358349150);
-        }
-
-        return $output;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/JsonViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/JsonViewHelper.php
deleted file mode 100644
index 69ced6c52716..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/JsonViewHelper.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
-
-/**
- * Wrapper for PHPs :php:`json_encode` function.
- * See https://www.php.net/manual/function.json-encode.php.
- *
- * Examples
- * ========
- *
- * Encoding a view variable
- * ------------------------
- *
- * ::
- *
- *    {someArray -> f:format.json()}
- *
- * ``["array","values"]``
- * Depending on the value of ``{someArray}``.
- *
- * Associative array
- * -----------------
- *
- * ::
- *
- *    {f:format.json(value: {foo: 'bar', bar: 'baz'})}
- *
- * ``{"foo":"bar","bar":"baz"}``
- *
- * Non associative array with forced object
- * ----------------------------------------
- *
- * ::
- *
- *    {f:format.json(value: {0: 'bar', 1: 'baz'}, forceObject: true)}
- *
- * ``{"0":"bar","1":"baz"}``
- */
-final class JsonViewHelper extends AbstractViewHelper
-{
-    use CompileWithContentArgumentAndRenderStatic;
-
-    /**
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'mixed', 'The incoming data to convert, or null if VH children should be used');
-        $this->registerArgument('forceObject', 'bool', 'Outputs an JSON object rather than an array', false, false);
-    }
-
-    /**
-     * Applies json_encode() on the specified value.
-     *
-     * Outputs content with its JSON representation. To prevent issues in HTML context, occurrences
-     * of greater-than or less-than characters are converted to their hexadecimal representations.
-     *
-     * If $forceObject is TRUE a JSON object is outputted even if the value is a non-associative array
-     * Example: array('foo', 'bar') as input will not be ["foo","bar"] but {"0":"foo","1":"bar"}
-     *
-     * @see https://www.php.net/manual/function.json-encode.php
-     * @return string|false
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $renderChildrenClosure();
-        $options = JSON_HEX_TAG;
-        if ($arguments['forceObject'] !== false) {
-            $options = $options | JSON_FORCE_OBJECT;
-        }
-        return json_encode($value, $options);
-    }
-
-    /**
-     * Explicitly set argument name to be used as content.
-     */
-    public function resolveContentArgumentName(): string
-    {
-        return 'value';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
deleted file mode 100644
index 9aa275fe7e74..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
-
-/**
- * Wrapper for PHPs :php:`nl2br` function.
- * See https://www.php.net/manual/function.nl2br.php.
- *
- * Examples
- * ========
- *
- * Default
- * -------
- *
- * ::
- *
- *    <f:format.nl2br>{text_with_linebreaks}</f:format.nl2br>
- *
- * Text with line breaks replaced by ``<br />``
- *
- * Inline notation
- * ---------------
- *
- * ::
- *
- *    {text_with_linebreaks -> f:format.nl2br()}
- *
- * Text with line breaks replaced by ``<br />``
- */
-final class Nl2brViewHelper extends AbstractViewHelper
-{
-    use CompileWithContentArgumentAndRenderStatic;
-
-    /**
-     * @var bool
-     */
-    protected $escapeOutput = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'string', 'string to format');
-    }
-
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
-    {
-        return nl2br((string)$renderChildrenClosure());
-    }
-
-    /**
-     * Explicitly set argument name to be used as content.
-     */
-    public function resolveContentArgumentName(): string
-    {
-        return 'value';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
deleted file mode 100644
index 38afa6c94f82..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * Formats a number with custom precision, decimal point and grouped thousands.
- * See https://www.php.net/manual/function.number-format.php.
- *
- * Examples
- * ========
- *
- * Defaults
- * --------
- *
- * ::
- *
- *    <f:format.number>423423.234</f:format.number>
- *
- * ``423,423.20``
- *
- * With all parameters
- * -------------------
- *
- * ::
- *
- *    <f:format.number decimals="1" decimalSeparator="," thousandsSeparator=".">
- *        423423.234
- *    </f:format.number>
- *
- * ``423.423,2``
- */
-final class NumberViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Output is escaped already. We must not escape children, to avoid double encoding.
-     *
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('decimals', 'int', 'The number of digits after the decimal point', false, 2);
-        $this->registerArgument('decimalSeparator', 'string', 'The decimal point character', false, '.');
-        $this->registerArgument('thousandsSeparator', 'string', 'The character for grouping the thousand digits', false, ',');
-    }
-
-    /**
-     * Format the numeric value as a number with grouped thousands, decimal point and precision.
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
-    {
-        $decimals = (int)$arguments['decimals'];
-        $decimalSeparator = $arguments['decimalSeparator'];
-        $thousandsSeparator = $arguments['thousandsSeparator'];
-        $stringToFormat = $renderChildrenClosure();
-        return number_format((float)$stringToFormat, $decimals, $decimalSeparator, $thousandsSeparator);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
deleted file mode 100644
index f04fc9031c4e..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
-
-/**
- * Removes tags from the given string (applying PHPs :php:`strip_tags()` function)
- * See https://www.php.net/manual/function.strip-tags.php.
- *
- * Examples
- * ========
- *
- * Default notation
- * ----------------
- *
- * ::
- *
- *    <f:format.stripTags>Some Text with <b>Tags</b> and an &Uuml;mlaut.</f:format.stripTags>
- *
- * Some Text with Tags and an &Uuml;mlaut. :php:`strip_tags()` applied.
- *
- * .. note::
- *    Encoded entities are not decoded.
- *
- * Default notation with allowedTags
- * ---------------------------------
- *
- * ::
- *
- *    <f:format.stripTags allowedTags="<p><span><div><script>">
- *        <p>paragraph</p><span>span</span><div>divider</div><iframe>iframe</iframe><script>script</script>
- *    </f:format.stripTags>
- *
- * Output::
- *
- *    <p>paragraph</p><span>span</span><div>divider</div>iframe<script>script</script>
- *
- * Inline notation
- * ---------------
- *
- * ::
- *
- *    {text -> f:format.stripTags()}
- *
- * Text without tags :php:`strip_tags()` applied.
- *
- * Inline notation with allowedTags
- * --------------------------------
- *
- * ::
- *
- *    {text -> f:format.stripTags(allowedTags: "<p><span><div><script>")}
- *
- * Text with p, span, div and script Tags inside, all other tags are removed.
- */
-final class StripTagsViewHelper extends AbstractViewHelper
-{
-    use CompileWithContentArgumentAndRenderStatic;
-
-    /**
-     * No output escaping as some tags may be allowed
-     *
-     * @var bool
-     */
-    protected $escapeOutput = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'string', 'string to format');
-        $this->registerArgument('allowedTags', 'string', 'Optional string of allowed tags as required by PHPs strip_tags() function');
-    }
-
-    /**
-     * To ensure all tags are removed, child node's output must not be escaped
-     *
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    /**
-     * Applies strip_tags() on the specified value if it's string-able.
-     *
-     * @see https://www.php.net/manual/function.strip-tags.php
-     * @return mixed
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $renderChildrenClosure();
-        $allowedTags = $arguments['allowedTags'];
-        if (!is_string($value) && !(is_object($value) && method_exists($value, '__toString'))) {
-            return $value;
-        }
-        return strip_tags((string)$value, $allowedTags);
-    }
-
-    /**
-     * Explicitly set argument name to be used as content.
-     */
-    public function resolveContentArgumentName(): string
-    {
-        return 'value';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/TrimViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/TrimViewHelper.php
deleted file mode 100644
index 38bb2bf2ba52..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/TrimViewHelper.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * This ViewHelper strips whitespace (or other characters) from the beginning and end of a string.
- *
- * Possible sides are:
- *
- * ``both`` (default)
- *   Strip whitespace (or other characters) from the beginning and end of a string
- *
- * ``left`` or ``start``
- *   Strip whitespace (or other characters) from the beginning of a string
- *
- * ``right`` or ``end``
- *   Strip whitespace (or other characters) from the end of a string
- *
- *
- * Examples
- * ========
- *
- * Defaults
- * --------
- * ::
- *
- *    #<f:format.trim>   String to be trimmed.   </f:format.trim>#
- *
- * .. code-block:: text
- *
- *    #String to be trimmed.#
- *
- *
- * Trim only one side
- * ------------------
- *
- * ::
- *
- *    #<f:format.trim side="right">   String to be trimmed.   </f:format.trim>#
- *
- * .. code-block:: text
- *
- *    #   String to be trimmed.#
- *
- *
- * Trim special characters
- * -----------------------
- *
- * ::
- *
- *    #<f:format.trim characters=" St.">   String to be trimmed.   </f:format.trim>#
- *
- * .. code-block:: text
- *
- *    #ring to be trimmed#
- */
-final class TrimViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    private const SIDE_BOTH = 'both';
-    private const SIDE_LEFT = 'left';
-    private const SIDE_START = 'start';
-    private const SIDE_RIGHT = 'right';
-    private const SIDE_END = 'end';
-
-    /**
-     * Output is escaped already. We must not escape children, to avoid double encoding.
-     *
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'string', 'The string value to be trimmed. If not given, the evaluated child nodes will be used.', false);
-        $this->registerArgument('characters', 'string', 'Optionally, the stripped characters can also be specified using the characters parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters.', false);
-        $this->registerArgument('side', 'string', 'The side to apply, must be one of this\' CASE_* constants. Defaults to both application.', false, self::SIDE_BOTH);
-    }
-
-    /**
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string the trimmed value
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $arguments['value'];
-        $characters = $arguments['characters'];
-        $side = $arguments['side'];
-
-        if ($value === null) {
-            $value = (string)$renderChildrenClosure();
-        } else {
-            $value = (string)$value;
-        }
-
-        if ($characters === null) {
-            $characters = " \t\n\r\0\x0B";
-        }
-
-        return match ($side) {
-            self::SIDE_BOTH => trim($value, $characters),
-            self::SIDE_LEFT, self::SIDE_START => ltrim($value, $characters),
-            self::SIDE_RIGHT, self::SIDE_END => rtrim($value, $characters),
-            default => throw new Exception(
-                'The side "' . $side . '" supplied to Fluid\'s format.trim ViewHelper is not supported.',
-                1669191560
-            ),
-        };
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
deleted file mode 100644
index 0bd752d67207..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
-
-/**
- * Encodes the given string according to http://www.faqs.org/rfcs/rfc3986.html
- * Applying PHPs :php:`rawurlencode()` function.
- * See https://www.php.net/manual/function.rawurlencode.php.
- *
- * .. note::
- *    The output is not escaped. You may have to ensure proper escaping on your own.
- *
- * Examples
- * ========
- *
- * Default notation
- * ----------------
- *
- * ::
- *
- *    <f:format.urlencode>foo @+%/</f:format.urlencode>
- *
- * ``foo%20%40%2B%25%2F`` :php:`rawurlencode()` applied.
- *
- * Inline notation
- * ---------------
- *
- * ::
- *
- *    {text -> f:format.urlencode()}
- *
- * Url encoded text :php:`rawurlencode()` applied.
- */
-final class UrlencodeViewHelper extends AbstractViewHelper
-{
-    use CompileWithContentArgumentAndRenderStatic;
-
-    /**
-     * Output is escaped already. We must not escape children, to avoid double encoding.
-     *
-     * @var bool
-     */
-    protected $escapeChildren = false;
-
-    public function initializeArguments(): void
-    {
-        $this->registerArgument('value', 'string', 'string to format');
-    }
-
-    /**
-     * Escapes special characters with their escaped counterparts as needed using PHPs rawurlencode() function.
-     *
-     * @see https://www.php.net/manual/function.rawurlencode.php
-     * @return mixed
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $renderChildrenClosure();
-        if (!is_string($value) && !(is_object($value) && method_exists($value, '__toString'))) {
-            return $value;
-        }
-        return rawurlencode((string)$value);
-    }
-
-    /**
-     * Explicitly set argument name to be used as content.
-     */
-    public function resolveContentArgumentName(): string
-    {
-        return 'value';
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/CaseViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/CaseViewHelperTest.php
deleted file mode 100644
index b4ac36f62f92..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/CaseViewHelperTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class CaseViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderConvertsAValueDataProvider(): array
-    {
-        return [
-            'empty value' => [
-                '<f:format.case value="" />',
-                '',
-            ],
-            'value from child, uppercase default' => [
-                '<f:format.case>foob4r</f:format.case>',
-                'FOOB4R',
-            ],
-            'simple value' => [
-                '<f:format.case value="foo" />',
-                'FOO',
-            ],
-            'mode lower' => [
-                '<f:format.case value="FooB4r" mode="lower" />',
-                'foob4r',
-            ],
-            'mode upper' => [
-                '<f:format.case value="FooB4r" mode="upper" />',
-                'FOOB4R',
-            ],
-            'mode capital' => [
-                '<f:format.case value="foo bar" mode="capital" />',
-                'Foo bar',
-            ],
-            'mode uncapital' => [
-                '<f:format.case value="FOO Bar" mode="uncapital" />',
-                'fOO Bar',
-            ],
-            'mode capital words' => [
-                '<f:format.case value="foo bar baz" mode="capitalWords" />',
-                'Foo Bar Baz',
-            ],
-            'special chars 1' => [
-                '<f:format.case value="smørrebrød" mode="upper" />',
-                'SMØRREBRØD',
-            ],
-            'special chars 2' => [
-                '<f:format.case value="smørrebrød" mode="capital" />',
-                'Smørrebrød',
-            ],
-            'special chars 3' => [
-                '<f:format.case value="römtömtömtöm" mode="upper" />',
-                'RÖMTÖMTÖMTÖM',
-            ],
-            'special chars 4' => [
-                '<f:format.case value="Ἕλλάς α ω" mode="upper" />',
-                'ἝΛΛΆΣ Α Ω',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderConvertsAValueDataProvider')]
-    #[Test]
-    public function renderConvertsAValue(string $src, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($src);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-
-    #[Test]
-    public function viewHelperThrowsExceptionIfIncorrectModeIsGiven(): void
-    {
-        $this->expectException(Exception::class);
-        $this->expectExceptionCode(1358349150);
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource('<f:format.case value="foo" mode="invalid" />');
-        (new TemplateView($context))->render();
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/Nl2brViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/Nl2brViewHelperTest.php
deleted file mode 100644
index 2f33455267d2..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/Nl2brViewHelperTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class Nl2brViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderDataProvider(): array
-    {
-        return [
-            'viewHelperDoesNotModifyTextWithoutLineBreaks' => [
-                '<f:format.nl2br><p class="bodytext">Some Text without line breaks</p></f:format.nl2br>',
-                '<p class="bodytext">Some Text without line breaks</p>',
-            ],
-            'viewHelperConvertsLineBreaksToBRTags' => [
-                '<f:format.nl2br>' . 'Line 1' . chr(10) . 'Line 2' . '</f:format.nl2br>',
-                'Line 1<br />' . chr(10) . 'Line 2',
-            ],
-            'viewHelperConvertsWindowsLineBreaksToBRTags' => [
-                '<f:format.nl2br>' . 'Line 1' . chr(13) . chr(10) . 'Line 2' . '</f:format.nl2br>',
-                'Line 1<br />' . chr(13) . chr(10) . 'Line 2',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderDataProvider')]
-    #[Test]
-    public function render(string $template, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($template);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/NumberViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/NumberViewHelperTest.php
deleted file mode 100644
index 64d6db2b9603..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/NumberViewHelperTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class NumberViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderDataProvider(): array
-    {
-        return [
-            'formatNumberDefaultsToEnglishNotationWithTwoDecimals' => [
-                '<f:format.number>3.1415926535898</f:format.number>',
-                '3.14',
-            ],
-            'formatNumberWithDecimalPoint' => [
-                '<f:format.number decimalSeparator=",">3.1415926535898</f:format.number>',
-                '3,14',
-            ],
-            'formatNumberWithDecimals' => [
-                '<f:format.number decimals="4">3.1415926535898</f:format.number>',
-                '3.1416',
-            ],
-            'formatNumberWithThousandsSeparator' => [
-                '<f:format.number thousandsSeparator=",">3141.5926535898</f:format.number>',
-                '3,141.59',
-            ],
-            'formatNumberWithEmptyInput' => [
-                '<f:format.number></f:format.number>',
-                '0.00',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderDataProvider')]
-    #[Test]
-    public function render(string $template, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($template);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/StripTagsViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/StripTagsViewHelperTest.php
deleted file mode 100644
index b73aab593655..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/StripTagsViewHelperTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class StripTagsViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderDataProvider(): array
-    {
-        return [
-            'renderUsesValueAsSourceIfSpecified' => [
-                '<f:format.stripTags value="Some string" />',
-                'Some string',
-            ],
-            'renderUsesChildnodesAsSourceIfSpecified' => [
-                '<f:format.stripTags>Some string</f:format.stripTags>',
-                'Some string',
-            ],
-            'no special chars' => [
-                '<f:format.stripTags>This is a sample text without special characters.</f:format.stripTags>',
-                'This is a sample text without special characters.',
-            ],
-            'some tags' => [
-                '<f:format.stripTags>This is a sample text <b>with <i>some</i> tags</b>.</f:format.stripTags>',
-                'This is a sample text with some tags.',
-            ],
-            'some umlauts' => [
-                '<f:format.stripTags>This text contains some &quot;&Uuml;mlaut&quot;.</f:format.stripTags>',
-                'This text contains some &quot;&Uuml;mlaut&quot;.',
-            ],
-            'allowed tags' => [
-                '<f:format.stripTags allowedTags="<strong>">This text <i>contains</i> some <strong>allowed</strong> tags.</f:format.stripTags>',
-                'This text contains some <strong>allowed</strong> tags.',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderDataProvider')]
-    #[Test]
-    public function render(string $template, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($template);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-
-    /**
-     * Ensures that objects are handled properly:
-     * + class having __toString() method gets tags stripped off
-     */
-    #[Test]
-    public function renderEscapesObjectIfPossible(): void
-    {
-        $toStringClass = new class () {
-            public function __toString(): string
-            {
-                return '<script>alert(\'"xss"\')</script>';
-            }
-        };
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource('<f:format.stripTags>{value}</f:format.stripTags>');
-        $view = new TemplateView($context);
-        $view->assign('value', $toStringClass);
-        self::assertEquals('alert(\'"xss"\')', $view->render());
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/TrimViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/TrimViewHelperTest.php
deleted file mode 100644
index d4452b8a7993..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/TrimViewHelperTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class TrimViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderConvertsAValueDataProvider(): array
-    {
-        return [
-            'empty value' => [
-                '<f:format.trim value="" />',
-                '',
-            ],
-            'simple' => [
-                '<f:format.trim value="  foo  " />',
-                'foo',
-            ],
-            'trim both' => [
-                '<f:format.trim value="  foo  " side="both" />',
-                'foo',
-            ],
-            'trim left' => [
-                '<f:format.trim value="  foo  " side="left" />',
-                'foo  ',
-            ],
-            'trim right' => [
-                '<f:format.trim value="  foo  " side="right" />',
-                '  foo',
-            ],
-            'trim start' => [
-                '<f:format.trim value="  foo  " side="start" />',
-                'foo  ',
-            ],
-            'trim end' => [
-                '<f:format.trim value="  foo  " side="end" />',
-                '  foo',
-            ],
-            'simple content' => [
-                '<f:format.trim>  foo  </f:format.trim>',
-                'foo',
-            ],
-            'trim content both' => [
-                '<f:format.trim side="both">  foo  </f:format.trim>',
-                'foo',
-            ],
-            'trim content left' => [
-                '<f:format.trim side="left">  foo  </f:format.trim>',
-                'foo  ',
-            ],
-            'trim content right' => [
-                '<f:format.trim side="right">  foo  </f:format.trim>',
-                '  foo',
-            ],
-            'trim content start' => [
-                '<f:format.trim side="start">  foo  </f:format.trim>',
-                'foo  ',
-            ],
-            'trim content end' => [
-                '<f:format.trim side="end">  foo  </f:format.trim>',
-                '  foo',
-            ],
-            'trim content multiline' => [
-                '<f:format.trim>
-                    foo
-                </f:format.trim>',
-                'foo',
-            ],
-            'trim content characters' => [
-                '<f:format.trim characters="bac">abc</f:format.trim>',
-                '',
-            ],
-            'do not trim middle characters' => [
-                '<f:format.trim characters="b">abc</f:format.trim>',
-                'abc',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderConvertsAValueDataProvider')]
-    #[Test]
-    public function renderTrimAValue(string $src, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($src);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-
-    #[Test]
-    public function viewHelperThrowsExceptionIfIncorrectModeIsGiven(): void
-    {
-        $this->expectException(Exception::class);
-        $this->expectExceptionCode(1669191560);
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource('<f:format.trim value="foo" side="invalid" />');
-        (new TemplateView($context))->render();
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/UrlencodeViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/UrlencodeViewHelperTest.php
deleted file mode 100644
index cb4c1b879457..000000000000
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Format/UrlencodeViewHelperTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Format;
-
-use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\Test;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-use TYPO3Fluid\Fluid\View\TemplateView;
-
-final class UrlencodeViewHelperTest extends FunctionalTestCase
-{
-    protected bool $initializeDatabase = false;
-
-    public static function renderDataProvider(): array
-    {
-        return [
-            'renderUsesValueAsSourceIfSpecified' => [
-                '<f:format.urlencode value="Source" />',
-                'Source',
-            ],
-            'renderUsesChildnodesAsSourceIfSpecified' => [
-                '<f:format.urlencode>Source</f:format.urlencode>',
-                'Source',
-            ],
-            'renderDoesNotModifyValueIfItDoesNotContainSpecialCharacters' => [
-                '<f:format.urlencode>StringWithoutSpecialCharacters</f:format.urlencode>',
-                'StringWithoutSpecialCharacters',
-            ],
-            'renderEncodesString' => [
-                '<f:format.urlencode>Foo @+%/ "</f:format.urlencode>',
-                'Foo%20%40%2B%25%2F%20%22',
-            ],
-        ];
-    }
-
-    #[DataProvider('renderDataProvider')]
-    #[Test]
-    public function render(string $template, string $expected): void
-    {
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource($template);
-        self::assertSame($expected, (new TemplateView($context))->render());
-    }
-
-    /**
-     * Ensures that objects are handled properly:
-     * + class having __toString() method gets tags stripped off
-     */
-    #[Test]
-    public function renderEscapesObjectIfPossible(): void
-    {
-        $toStringClass = new class () {
-            public function __toString(): string
-            {
-                return '<script>alert(\'"xss"\')</script>';
-            }
-        };
-        $context = $this->get(RenderingContextFactory::class)->create();
-        $context->getTemplatePaths()->setTemplateSource('<f:format.urlencode>{value}</f:format.urlencode>');
-        $view = new TemplateView($context);
-        $view->assign('value', $toStringClass);
-        self::assertEquals('%3Cscript%3Ealert%28%27%22xss%22%27%29%3C%2Fscript%3E', $view->render());
-    }
-}
-- 
GitLab