From 8b693daac0cc381f10c74bc5d78b2448f55111f3 Mon Sep 17 00:00:00 2001
From: Claus Due <claus@namelesscoder.net>
Date: Thu, 11 Jun 2015 14:06:35 +0200
Subject: [PATCH] [!!!][FEATURE] Switch to standalone Fluid template engine

This change:

* Adds `typo3fluid/fluid` as dependency
* Converts system extension `fluid` to a so-called Fluid adapter
* Adds TYPO3-specific Fluid integrations as compatibility layer
* Turns Fluid's RenderingContext into a very flexible API
* Updates a few templates and core ViewHelpers for compatibility

On a more general level the change allows using a wide array of
new template syntaxes and integration features (see feature
documentation included with this commit in `core` extension).

The breaking changes are minimal; mostly caused by removal of
deprecated code from the `fluid` system extension (rather than
fundamental changes to how Fluid itself works). Custom templates
should work with little or no migration required.

Change-Id: Ib505cb66dabcc711868924d2fab3015ce549fbde
Releases: master
Resolves: #62940
Resolves: #69863
Resolves: #58752
Resolves: #48221
Resolves: #49903
Resolves: #54509
Resolves: #55343
Resolves: #55660
Resolves: #57446
Resolves: #70036
Resolves: #61144
Resolves: #60082
Resolves: #11287
Resolves: #70960
Resolves: #71552
Resolves: #67930
Resolves: #48656
Resolves: #71821
Resolves: #59540
Reviewed-on: https://review.typo3.org/42425
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Marc Neuhaus <apocalip@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 composer.json                                 |    8 +-
 composer.lock                                 |   42 +-
 .../Classes/ViewHelpers/AvatarViewHelper.php  |    3 +-
 .../ViewHelpers/Be/PagePathViewHelper.php     |    3 +-
 .../ViewHelpers/ErrorIconViewHelper.php       |    3 +-
 .../Form/TranslateLabelSelectViewHelper.php   |    2 +-
 .../ViewHelpers/FormatDetailsViewHelper.php   |    3 +-
 .../ViewHelpers/HistoryEntryViewHelper.php    |    3 +-
 .../IsExtensionLoadedViewHelper.php           |    3 +-
 .../ViewHelpers/UsernameViewHelper.php        |    3 +-
 .../ViewHelpers/WorkspaceTitleViewHelper.php  |    3 +-
 .../ViewHelpers/ArrayElementViewHelper.php    |    3 +-
 .../ViewHelpers/Display/PagesViewHelper.php   |    3 +-
 .../Display/SysFileMountsViewHelper.php       |    3 +-
 .../Display/SysLanguageViewHelper.php         |    3 +-
 .../ViewHelpers/EditRecordViewHelper.php      |    3 +-
 .../ViewHelpers/IssueCommandViewHelper.php    |    3 +-
 .../ViewHelpers/PermissionsViewHelper.php     |    5 +-
 .../ViewHelpers/RemoveUserViewHelper.php      |    3 +-
 .../SpriteIconForRecordViewHelper.php         |    3 +-
 .../ViewHelpers/SwitchUserViewHelper.php      |    3 +-
 .../Classes/ViewHelpers/IconViewHelper.php    |    3 +-
 .../Configuration/DefaultConfiguration.php    |    2 +-
 ...hangesInViewHelpersPostFluidStandalone.rst |   69 +
 ...viourChangedFromENT_COMPATToENT_QUOTES.rst |   26 +
 ...9863-RemovedDeprecatedCodeFromExtfluid.rst |   49 +
 ...teGetTemplateVariableContainerFunction.rst |   26 +
 ...NewStandaloneFluidAsComposerDependency.rst |  361 ++++++
 .../Classes/ViewHelpers/FormatViewHelper.php  |    3 +-
 .../Classes/ViewHelpers/FormatsViewHelper.php |    3 +-
 .../Unit/Utility/DebuggerUtilityTest.php      |    4 +-
 .../ViewHelpers/Format/ImplodeViewHelper.php  |    3 +-
 .../Format/JsonEncodeViewHelper.php           |    3 +-
 .../InstallationStateCssClassViewHelper.php   |    3 +-
 .../TimeSinceLastUpdateViewHelper.php         |    3 +-
 .../ViewHelpers/Typo3DependencyViewHelper.php |    3 +-
 .../ViewHelpers/Uri/DeleteFileViewHelper.php  |    3 +-
 .../Uri/EditFileContentViewHelper.php         |    3 +-
 .../EditSysFileMetadataRecordViewHelper.php   |    3 +-
 .../ViewHelpers/Uri/RenameFileViewHelper.php  |    3 +-
 .../ViewHelpers/Uri/ReplaceFileViewHelper.php |    3 +-
 typo3/sysext/fluid/ChangeLog                  |  585 ---------
 .../Compatibility/DocbookGeneratorService.php |   96 --
 .../Compatibility/TemplateParserBuilder.php   |   35 -
 .../Classes/Core/Cache/FluidTemplateCache.php |   63 +
 .../Compiler/AbstractCompiledTemplate.php     |  101 --
 .../Core/Compiler/TemplateCompiler.php        |  430 -------
 typo3/sysext/fluid/Classes/Core/Exception.php |   20 -
 .../Classes/Core/Parser/Configuration.php     |   58 -
 .../fluid/Classes/Core/Parser/Exception.php   |   20 -
 .../Core/Parser/Interceptor/Escape.php        |   87 --
 .../Core/Parser/InterceptorInterface.php      |   42 -
 .../Core/Parser/ParsedTemplateInterface.php   |   66 -
 .../Classes/Core/Parser/ParsingState.php      |  213 ----
 .../XmlnsNamespaceTemplatePreProcessor.php    |   85 ++
 .../Core/Parser/SyntaxTree/AbstractNode.php   |   84 --
 .../Core/Parser/SyntaxTree/ArrayNode.php      |   65 -
 .../Core/Parser/SyntaxTree/BooleanNode.php    |  352 -----
 .../LegacyNamespaceExpressionNode.php         |   42 +
 .../Core/Parser/SyntaxTree/NodeInterface.php  |   49 -
 .../Core/Parser/SyntaxTree/NumericNode.php    |   72 --
 .../Parser/SyntaxTree/ObjectAccessorNode.php  |   99 --
 .../Core/Parser/SyntaxTree/RootNode.php       |   29 -
 .../Core/Parser/SyntaxTree/TextNode.php       |   61 -
 .../Core/Parser/SyntaxTree/ViewHelperNode.php |  151 ---
 .../Classes/Core/Parser/TemplateParser.php    |  973 --------------
 .../Core/Rendering/RenderingContext.php       |  187 ++-
 .../Rendering/RenderingContextInterface.php   |   36 -
 .../Core/Variables/CmsVariableProvider.php    |   37 +
 .../AbstractConditionViewHelper.php           |  252 +---
 .../ViewHelper/AbstractTagBasedViewHelper.php |   53 +-
 .../Core/ViewHelper/AbstractViewHelper.php    |  273 +---
 .../Core/ViewHelper/ArgumentDefinition.php    |  115 +-
 .../Classes/Core/ViewHelper/Arguments.php     |  105 --
 .../Classes/Core/ViewHelper/Exception.php     |   20 -
 .../Exception/InvalidVariableException.php    |   20 -
 ...RenderingContextNotAccessibleException.php |   20 -
 .../Facets/ChildNodeAccessInterface.php       |   35 -
 .../ViewHelper/Facets/CompilableInterface.php |  102 --
 .../ViewHelper/Facets/PostParseInterface.php  |   43 -
 .../Classes/Core/ViewHelper/TagBuilder.php    |  253 ----
 .../ViewHelper/TemplateVariableContainer.php  |  213 ----
 .../Core/ViewHelper/ViewHelperInterface.php   |   25 -
 .../Core/ViewHelper/ViewHelperResolver.php    |   71 ++
 .../ViewHelperVariableContainer.php           |  150 ---
 .../Core/Widget/AbstractWidgetController.php  |   55 +-
 .../Core/Widget/AbstractWidgetViewHelper.php  |   79 +-
 .../Core/Widget/AjaxWidgetContextHolder.php   |   30 +-
 .../fluid/Classes/Core/Widget/Bootstrap.php   |   30 +-
 .../fluid/Classes/Core/Widget/Exception.php   |   34 +-
 .../Exception/MissingControllerException.php  |   30 +-
 .../RenderingContextNotFoundException.php     |   30 +-
 .../WidgetContextNotFoundException.php        |   30 +-
 .../WidgetRequestNotFoundException.php        |   30 +-
 .../Classes/Core/Widget/WidgetContext.php     |   30 +-
 .../Classes/Core/Widget/WidgetRequest.php     |   30 +-
 .../Core/Widget/WidgetRequestBuilder.php      |   43 +-
 .../Core/Widget/WidgetRequestHandler.php      |   33 +-
 typo3/sysext/fluid/Classes/Exception.php      |   18 -
 typo3/sysext/fluid/Classes/Fluid.php          |   33 -
 .../Classes/Service/AbstractGenerator.php     |  117 --
 .../Classes/Service/DocbookGenerator.php      |  199 ---
 .../Classes/View/AbstractTemplateView.php     |  465 +------
 typo3/sysext/fluid/Classes/View/Exception.php |   20 -
 .../Exception/InvalidSectionException.php     |   20 -
 .../InvalidTemplateResourceException.php      |   20 -
 .../fluid/Classes/View/StandaloneView.php     |  425 +------
 .../fluid/Classes/View/TemplatePaths.php      |  146 +++
 .../fluid/Classes/View/TemplateView.php       |  583 +--------
 .../Classes/ViewHelpers/AliasViewHelper.php   |   87 --
 .../Classes/ViewHelpers/BaseViewHelper.php    |   28 +-
 .../Be/AbstractBackendViewHelper.php          |   31 +-
 .../ViewHelpers/Be/Buttons/CshViewHelper.php  |   53 +-
 .../ViewHelpers/Be/Buttons/IconViewHelper.php |  114 --
 .../Be/Buttons/ShortcutViewHelper.php         |   40 +-
 .../ViewHelpers/Be/ContainerViewHelper.php    |   31 +-
 .../ViewHelpers/Be/InfoboxViewHelper.php      |    9 +-
 .../Menus/ActionMenuItemGroupViewHelper.php   |   19 +-
 .../Be/Menus/ActionMenuItemViewHelper.php     |   32 +-
 .../Be/Menus/ActionMenuViewHelper.php         |   52 +-
 .../ViewHelpers/Be/PageInfoViewHelper.php     |   34 +-
 .../ViewHelpers/Be/PagePathViewHelper.php     |   34 +-
 .../Be/Security/IfAuthenticatedViewHelper.php |   44 +-
 .../Be/Security/IfHasRoleViewHelper.php       |   44 +-
 .../ViewHelpers/Be/TableListViewHelper.php    |   50 +-
 .../Widget/Controller/PaginateController.php  |   33 +-
 .../Be/Widget/PaginateViewHelper.php          |   30 +-
 .../Classes/ViewHelpers/CObjectViewHelper.php |   43 +-
 .../Classes/ViewHelpers/CaseViewHelper.php    |   84 --
 .../Classes/ViewHelpers/CommentViewHelper.php |   82 --
 .../Classes/ViewHelpers/CountViewHelper.php   |   83 --
 .../Classes/ViewHelpers/CycleViewHelper.php   |  111 --
 .../Classes/ViewHelpers/DebugViewHelper.php   |   37 +-
 .../Classes/ViewHelpers/ElseViewHelper.php    |   65 -
 .../ViewHelpers/FlashMessagesViewHelper.php   |   79 +-
 .../Classes/ViewHelpers/ForViewHelper.php     |  141 --
 .../Form/AbstractFormFieldViewHelper.php      |   69 +-
 .../Form/AbstractFormViewHelper.php           |   21 +-
 .../ViewHelpers/Form/ButtonViewHelper.php     |   22 +-
 .../ViewHelpers/Form/CheckboxViewHelper.php   |   22 +-
 .../ViewHelpers/Form/HiddenViewHelper.php     |   21 +-
 .../ViewHelpers/Form/PasswordViewHelper.php   |   22 +-
 .../ViewHelpers/Form/RadioViewHelper.php      |   22 +-
 .../ViewHelpers/Form/SelectViewHelper.php     |   22 +-
 .../ViewHelpers/Form/SubmitViewHelper.php     |   22 +-
 .../ViewHelpers/Form/TextareaViewHelper.php   |   21 +-
 .../ViewHelpers/Form/TextfieldViewHelper.php  |   21 +-
 .../ViewHelpers/Form/UploadViewHelper.php     |   32 +-
 .../Form/ValidationResultsViewHelper.php      |   31 +-
 .../Classes/ViewHelpers/FormViewHelper.php    |   55 +-
 .../Format/AbstractEncodingViewHelper.php     |   25 +-
 .../ViewHelpers/Format/BytesViewHelper.php    |   24 +-
 .../ViewHelpers/Format/CaseViewHelper.php     |   24 +-
 .../ViewHelpers/Format/CdataViewHelper.php    |   87 --
 .../ViewHelpers/Format/CropViewHelper.php     |   27 +-
 .../ViewHelpers/Format/CurrencyViewHelper.php |   24 +-
 .../ViewHelpers/Format/DateViewHelper.php     |   31 +-
 .../ViewHelpers/Format/HtmlViewHelper.php     |   38 +-
 .../Format/HtmlentitiesDecodeViewHelper.php   |   29 +-
 .../Format/HtmlentitiesViewHelper.php         |   32 +-
 .../Format/HtmlspecialcharsViewHelper.php     |   92 --
 .../ViewHelpers/Format/Nl2brViewHelper.php    |   24 +-
 .../ViewHelpers/Format/NumberViewHelper.php   |   24 +-
 .../ViewHelpers/Format/PaddingViewHelper.php  |   24 +-
 .../ViewHelpers/Format/PrintfViewHelper.php   |   94 --
 .../ViewHelpers/Format/RawViewHelper.php      |   92 --
 .../Format/StripTagsViewHelper.php            |   34 +-
 .../Format/UrlencodeViewHelper.php            |   34 +-
 .../ViewHelpers/GroupedForViewHelper.php      |  141 --
 .../Classes/ViewHelpers/IfViewHelper.php      |   93 --
 .../Classes/ViewHelpers/LayoutViewHelper.php  |   69 -
 .../ViewHelpers/Link/ActionViewHelper.php     |   28 +-
 .../ViewHelpers/Link/EmailViewHelper.php      |   25 +-
 .../ViewHelpers/Link/ExternalViewHelper.php   |   21 +-
 .../ViewHelpers/Link/PageViewHelper.php       |   27 +-
 .../ViewHelpers/Link/TypolinkViewHelper.php   |   28 +-
 .../Classes/ViewHelpers/MediaViewHelper.php   |    1 -
 .../ViewHelpers/RenderChildrenViewHelper.php  |   30 +-
 .../Classes/ViewHelpers/RenderViewHelper.php  |  142 ---
 .../Classes/ViewHelpers/SectionViewHelper.php |  119 --
 .../Security/IfAuthenticatedViewHelper.php    |   44 +-
 .../Security/IfHasRoleViewHelper.php          |   44 +-
 .../ViewHelpers/SpacelessViewHelper.php       |   63 -
 .../Classes/ViewHelpers/SwitchViewHelper.php  |  124 --
 .../Classes/ViewHelpers/ThenViewHelper.php    |   53 -
 .../ViewHelpers/TranslateViewHelper.php       |   28 +-
 .../ViewHelpers/Uri/ActionViewHelper.php      |   25 +-
 .../ViewHelpers/Uri/EmailViewHelper.php       |   28 +-
 .../ViewHelpers/Uri/ExternalViewHelper.php    |   25 +-
 .../ViewHelpers/Uri/ImageViewHelper.php       |    3 +-
 .../ViewHelpers/Uri/PageViewHelper.php        |   28 +-
 .../ViewHelpers/Uri/ResourceViewHelper.php    |   28 +-
 .../ViewHelpers/Uri/TypolinkViewHelper.php    |   28 +-
 .../Widget/AutocompleteViewHelper.php         |   32 +-
 .../Controller/AutocompleteController.php     |   35 +-
 .../Widget/Controller/PaginateController.php  |   31 +-
 .../ViewHelpers/Widget/LinkViewHelper.php     |   32 +-
 .../ViewHelpers/Widget/PaginateViewHelper.php |   31 +-
 .../ViewHelpers/Widget/UriViewHelper.php      |   30 +-
 .../fluid/Migrations/Code/ClassAliasMap.php   |   27 +
 .../Migrations/Code/LegacyClassesForIde.php   |   96 ++
 .../EscapeChildrenRenderingStandaloneTest.php |  120 ++
 .../EscapeChildrenRenderingTest.php           |  120 ++
 .../Fixtures/Extensions/fluid_test/.gitignore |    2 +
 .../AbstractEscapingBaseViewHelper.php        |   42 +
 ...abledAndEscapeOutputDisabledViewHelper.php |   24 +
 ...sabledAndEscapeOutputEnabledViewHelper.php |   24 +
 ...abledAndEscapeOutputDisabledViewHelper.php |   24 +
 ...abledAndEscapeOutputEnabledViewHelper.php} |    9 +-
 .../Fixtures/Extensions/fluid_test/README.md  |    2 +
 .../Extensions/fluid_test/composer.json       |   58 +
 .../Extensions/fluid_test/ext_emconf.php      |   47 +
 .../Extensions/fluid_test/ext_icon.gif        |  Bin 0 -> 177 bytes
 .../Core/Cache/FluidTemplateCacheTest.php     |   77 ++
 .../Compiler/AbstractCompilerTemplateTest.php |   37 -
 .../Unit/Core/Fixtures/TestViewHelper.php     |   16 +
 .../Unit/Core/Fixtures/TestViewHelper2.php    |   16 +
 .../ChildNodeAccessFacetViewHelper.php        |   19 -
 .../Fixtures/PostParseFacetViewHelper.php     |   37 -
 ...ateParserTestFixture01-shorthand-split.php |    4 -
 ...TemplateParserTestFixture01-shorthand.html |    2 -
 .../TemplateParserTestFixture06-split.php     |    3 -
 .../Fixtures/TemplateParserTestFixture06.html |    1 -
 .../TemplateParserTestFixture14-split.php     |    7 -
 .../Fixtures/TemplateParserTestFixture14.html |    1 -
 .../Core/Parser/Interceptor/EscapeTest.php    |  105 --
 .../Unit/Core/Parser/ParsingStateTest.php     |   65 -
 ...XmlnsNamespaceTemplatePreProcessorTest.php |  235 ++++
 .../Parser/SyntaxTree/AbstractNodeTest.php    |   51 -
 .../Parser/SyntaxTree/BooleanNodeTest.php     |  499 --------
 .../LegacyNamespaceExpressionNodeTest.php     |   56 +
 .../Parser/SyntaxTree/NumericNodeTest.php     |   57 -
 .../Core/Parser/SyntaxTree/TextNodeTest.php   |   37 -
 .../Parser/SyntaxTree/ViewHelperNodeTest.php  |  162 ---
 .../Core/Parser/TemplateParserPatternTest.php |  379 ------
 .../Unit/Core/Parser/TemplateParserTest.php   | 1131 -----------------
 .../Rendering/RenderingContextFixture.php     |   29 +
 .../Core/Rendering/RenderingContextTest.php   |   57 +-
 .../Variables/CmsVariableProviderTest.php     |   32 +
 .../AbstractConditionViewHelperTest.php       |  158 ---
 .../AbstractTagBasedViewHelperTest.php        |  138 --
 .../ViewHelper/AbstractViewHelperTest.php     |  161 ++-
 .../ViewHelper/ArgumentDefinitionTest.php     |   21 +-
 .../Unit/Core/ViewHelper/TagBuilderTest.php   |  228 ----
 .../TemplateVariableContainerTest.php         |  144 ---
 .../ViewHelper/ViewHelperResolverTest.php     |   63 +
 .../ViewHelperVariableContainerTest.php       |  125 --
 .../Widget/AbstractWidgetControllerTest.php   |  132 +-
 .../Widget/AbstractWidgetViewHelperTest.php   |   76 +-
 .../Widget/AjaxWidgetContextHolderTest.php    |   31 +-
 .../Unit/Core/Widget/WidgetContextTest.php    |   87 +-
 .../Core/Widget/WidgetRequestBuilderTest.php  |   31 +-
 .../Core/Widget/WidgetRequestHandlerTest.php  |   56 +-
 .../Unit/Core/Widget/WidgetRequestTest.php    |   44 +-
 .../Unit/View/AbstractTemplateViewTest.php    |  122 +-
 .../View/Fixtures/TemplateViewFixture.php     |   23 +-
 .../Fixtures/TransparentSyntaxTreeNode.php    |   27 +-
 .../Tests/Unit/View/StandaloneViewTest.php    |  852 +------------
 .../Tests/Unit/View/TemplateViewTest.php      |  799 ------------
 .../Unit/ViewHelpers/AliasViewHelperTest.php  |   65 -
 .../Unit/ViewHelpers/BaseViewHelperTest.php   |   21 +-
 .../IfAuthenticatedViewHelperTest.php         |   33 +-
 .../IfHasRoleViewHelperTest.php               |   33 +-
 .../Unit/ViewHelpers/CaseViewHelperTest.php   |  185 ---
 .../Unit/ViewHelpers/CountViewHelperTest.php  |   93 --
 .../Unit/ViewHelpers/CycleViewHelperTest.php  |  131 --
 .../Unit/ViewHelpers/ElseViewHelperTest.php   |   42 -
 .../Fixtures/ConstraintSyntaxTreeNode.php     |   44 -
 ...anslateViewHelperFixtureForEmptyString.php |    1 -
 ...teViewHelperFixtureForTranslatedString.php |    1 -
 .../FlashMessagesViewHelperTest.php           |   31 +-
 .../Unit/ViewHelpers/ForViewHelperTest.php    |  429 -------
 .../Form/AbstractFormFieldViewHelperTest.php  |  144 ---
 .../Form/AbstractFormViewHelperTest.php       |   31 +-
 .../ViewHelpers/Form/ButtonViewHelperTest.php |   21 +-
 .../Form/CheckboxViewHelperTest.php           |   22 +-
 .../Form/Fixtures/ClassWithTwoGetters.php     |    2 +-
 .../ViewHelpers/Form/Fixtures/EmptyClass.php  |    2 +-
 .../Form/Fixtures/EmptySyntaxTreeNode.php     |   21 +-
 .../Form/Fixtures/ExtendsAbstractEntity.php   |    2 +-
 .../Form/Fixtures/UserDomainClass.php         |   21 +-
 .../Form/FormFieldViewHelperBaseTestcase.php  |   36 +-
 .../ViewHelpers/Form/HiddenViewHelperTest.php |   22 +-
 .../Form/PasswordViewHelperTest.php           |   21 +-
 .../ViewHelpers/Form/RadioViewHelperTest.php  |   22 +-
 .../ViewHelpers/Form/SelectViewHelperTest.php |   21 +-
 .../ViewHelpers/Form/SubmitViewHelperTest.php |   21 +-
 .../Form/TextareaViewHelperTest.php           |   21 +-
 .../Form/TextfieldViewHelperTest.php          |   21 +-
 .../ViewHelpers/Form/UploadViewHelperTest.php |   21 +-
 .../Unit/ViewHelpers/FormViewHelperTest.php   |   67 +-
 .../Format/BytesViewHelperTest.php            |   22 +-
 .../ViewHelpers/Format/CaseViewHelperTest.php |   22 +-
 .../ViewHelpers/Format/CropViewHelperTest.php |   35 +-
 .../Format/CurrencyViewHelperTest.php         |   23 +-
 .../ViewHelpers/Format/DateViewHelperTest.php |   23 +-
 .../HtmlentitiesDecodeViewHelperTest.php      |   32 +-
 .../Format/HtmlentitiesViewHelperTest.php     |   29 +-
 .../Format/HtmlspecialcharsViewHelperTest.php |  137 --
 .../Format/Nl2brViewHelperTest.php            |   22 +-
 .../Format/NumberViewHelperTest.php           |   24 +-
 .../Format/PaddingViewHelperTest.php          |   22 +-
 .../Format/PrintfViewHelperTest.php           |   54 -
 .../ViewHelpers/Format/RawViewHelperTest.php  |   63 -
 .../Format/StripTagsViewHelperTest.php        |   30 +-
 .../Format/UrlencodeViewHelperTest.php        |   31 +-
 .../ViewHelpers/GroupedForViewHelperTest.php  |  315 -----
 .../Unit/ViewHelpers/IfViewHelperTest.php     |   61 -
 .../Unit/ViewHelpers/ImageViewHelperTest.php  |  166 +++
 .../ViewHelpers/Link/EmailViewHelperTest.php  |   26 +-
 .../Link/ExternalViewHelperTest.php           |   21 +-
 .../ViewHelpers/Link/PageViewHelperTest.php   |   25 +-
 .../Link/TypolinkViewHelperTest.php           |   27 +-
 .../RenderChildrenViewHelperTest.php          |   96 --
 .../Unit/ViewHelpers/RenderViewHelperTest.php |   85 --
 .../IfAuthenticatedViewHelperTest.php         |   31 +-
 .../Security/IfHasRoleViewHelperTest.php      |   31 +-
 .../ViewHelpers/SpacelessViewHelperTest.php   |   78 --
 .../Unit/ViewHelpers/SwitchViewHelperTest.php |   65 -
 .../Unit/ViewHelpers/ThenViewHelperTest.php   |   42 -
 .../ViewHelpers/TranslateViewHelperTest.php   |    1 -
 .../ViewHelpers/Uri/EmailViewHelperTest.php   |   31 +-
 .../Uri/ExternalViewHelperTest.php            |   21 +-
 .../ViewHelpers/Uri/PageViewHelperTest.php    |    1 -
 .../Uri/TypolinkViewHelperTest.php            |   25 +-
 .../ViewHelpers/ViewHelperBaseTestcase.php    |   41 +-
 .../Controller/PaginateControllerTest.php     |   21 +-
 .../Private/Partials/Header/Header.html       |    6 +-
 .../Private/Partials/Header/SubHeader.html    |    6 +-
 .../Private/Partials/MediaGallery.html        |    4 +-
 .../ViewHelpers/Format/DateTimeViewHelper.php |    3 +-
 .../Format/FlagValueViewHelper.php            |    3 +-
 .../Format/GroupListViewHelper.php            |    3 +-
 .../PageBrowsingResultsViewHelper.php         |    3 +-
 .../ViewHelpers/PageBrowsingViewHelper.php    |    3 +-
 .../Templates/Administration/Statistic.html   |   14 +-
 .../Controller/Action/AbstractAction.php      |    2 +-
 .../install/Classes/View/StandaloneView.php   |   45 -
 .../ViewHelpers/Be/ContainerViewHelper.php    |   10 +
 .../ViewHelpers/ConstantViewHelper.php        |    3 +-
 .../ViewHelpers/File/ExistsViewHelper.php     |    3 +-
 .../File/ImageDimensionViewHelper.php         |    3 +-
 .../File/RelativePathViewHelper.php           |    3 +-
 .../ViewHelpers/File/SizeViewHelper.php       |    3 +-
 .../ViewHelpers/Format/CropViewHelper.php     |    3 +-
 .../Format/ImageMagickCommandsViewHelper.php  |    3 +-
 .../Format/PhpErrorCodeViewHelper.php         |    3 +-
 .../Object/ArrayValueByKeyViewHelper.php      |    3 +-
 .../Classes/ViewHelpers/PhpInfoViewHelper.php |   13 +-
 .../Resources/Private/Layouts/Step.html       |    2 +-
 .../Partials/Action/Common/StatusMessage.html |    5 +-
 .../Format/PhpErrorCodeViewHelperTest.php     |    3 +-
 .../Classes/ViewHelpers/IconViewHelper.php    |    3 +-
 .../Private/Templates/Report/Detail.html      |    4 +-
 .../ViewHelpers/ModuleLinkViewHelper.php      |    3 +-
 .../ViewHelpers/DeleteLinkViewHelper.php      |    3 +-
 .../ViewHelpers/EditLinkViewHelper.php        |    3 +-
 357 files changed, 5152 insertions(+), 18661 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-ChangesInViewHelpersPostFluidStandalone.rst
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-FluidEscapingBehaviourChangedFromENT_COMPATToENT_QUOTES.rst
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-RemovedDeprecatedCodeFromExtfluid.rst
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-69863-DeprecateGetTemplateVariableContainerFunction.rst
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Feature-69863-UseNewStandaloneFluidAsComposerDependency.rst
 delete mode 100644 typo3/sysext/fluid/ChangeLog
 delete mode 100644 typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
 delete mode 100644 typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
 create mode 100644 typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Compiler/AbstractCompiledTemplate.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Exception.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/Configuration.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/Exception.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/ParsedTemplateInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/ParsingState.php
 create mode 100644 typo3/sysext/fluid/Classes/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessor.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/AbstractNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ArrayNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php
 create mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/Expression/LegacyNamespaceExpressionNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NumericNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/RootNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/TextNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ViewHelperNode.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/Rendering/RenderingContextInterface.php
 create mode 100644 typo3/sysext/fluid/Classes/Core/Variables/CmsVariableProvider.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Arguments.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Exception.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/InvalidVariableException.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/RenderingContextNotAccessibleException.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/ChildNodeAccessInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/CompilableInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/PostParseInterface.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/TagBuilder.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/TemplateVariableContainer.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperInterface.php
 create mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolver.php
 delete mode 100644 typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperVariableContainer.php
 delete mode 100644 typo3/sysext/fluid/Classes/Exception.php
 delete mode 100644 typo3/sysext/fluid/Classes/Fluid.php
 delete mode 100644 typo3/sysext/fluid/Classes/Service/AbstractGenerator.php
 delete mode 100644 typo3/sysext/fluid/Classes/Service/DocbookGenerator.php
 delete mode 100644 typo3/sysext/fluid/Classes/View/Exception.php
 delete mode 100644 typo3/sysext/fluid/Classes/View/Exception/InvalidSectionException.php
 delete mode 100644 typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php
 create mode 100644 typo3/sysext/fluid/Classes/View/TemplatePaths.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/AliasViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/CommentViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/CountViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/CycleViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/ElseViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/CdataViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlspecialcharsViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/PrintfViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/Format/RawViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/GroupedForViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/IfViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/LayoutViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/SectionViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/SpacelessViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Classes/ViewHelpers/ThenViewHelper.php
 create mode 100644 typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php
 create mode 100644 typo3/sysext/fluid/Migrations/Code/LegacyClassesForIde.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingStandaloneTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/.gitignore
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/AbstractEscapingBaseViewHelper.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper.php
 rename typo3/sysext/fluid/Tests/{Unit/Core/Compiler/Fixtures/AbstractCompiledTemplate.php => Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper.php} (61%)
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/README.md
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/composer.json
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_emconf.php
 create mode 100644 typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_icon.gif
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Cache/FluidTemplateCacheTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Compiler/AbstractCompilerTemplateTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/ChildNodeAccessFacetViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/PostParseFacetViewHelper.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand-split.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand.html
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06.html
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14.html
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/Interceptor/EscapeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/ParsingStateTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessorTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/AbstractNodeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/LegacyNamespaceExpressionNodeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/NumericNodeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/TextNodeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserPatternTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextFixture.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/Variables/CmsVariableProviderTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractConditionViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractTagBasedViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TagBuilderTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TemplateVariableContainerTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperVariableContainerTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/View/TemplateViewTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/AliasViewHelperTest.php
 rename typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/{ => Security}/IfAuthenticatedViewHelperTest.php (51%)
 rename typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/{ => Security}/IfHasRoleViewHelperTest.php (65%)
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/CountViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/CycleViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/ElseViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/ConstraintSyntaxTreeNode.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/ForViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PrintfViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/RawViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/GroupedForViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/IfViewHelperTest.php
 create mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/ImageViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderChildrenViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/SpacelessViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/SwitchViewHelperTest.php
 delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/ThenViewHelperTest.php
 delete mode 100644 typo3/sysext/install/Classes/View/StandaloneView.php

diff --git a/composer.json b/composer.json
index 091a221b2e08..89ccc0ea041b 100644
--- a/composer.json
+++ b/composer.json
@@ -43,7 +43,8 @@
 		"typo3/cms-composer-installers": "^1.2.5",
 		"psr/http-message": "~1.0",
 		"cogpowered/finediff": "~0.3.1",
-		"mso/idna-convert": "^0.9.1"
+		"mso/idna-convert": "^0.9.1",
+		"typo3fluid/fluid": "^1.0.3"
 	},
 	"require-dev": {
 		"phpunit/phpunit": "~4.8.0",
@@ -58,7 +59,10 @@
 	},
 	"extra": {
 		"typo3/class-alias-loader": {
-			"always-add-alias-loader": true
+			"always-add-alias-loader": true,
+			"class-alias-maps": [
+				"typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php"
+			]
 		},
 		"branch-alias": {
 			"dev-master": "7.x-dev"
diff --git a/composer.lock b/composer.lock
index 8f97c3c1fd8f..8f4be595a9e9 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "41598b90e8e110bf0f35092212ce802c",
-    "content-hash": "2d42a93c330f37e0f0e74072652d123a",
+    "hash": "b3ee1a2e920605bac9c105764365761e",
+    "content-hash": "d06ab9b6a8fe495278326559effe7788",
     "packages": [
         {
             "name": "cogpowered/finediff",
@@ -705,6 +705,44 @@
                 "typo3"
             ],
             "time": "2015-11-03 21:19:57"
+        },
+        {
+            "name": "typo3fluid/fluid",
+            "version": "1.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/TYPO3Fluid/Fluid.git",
+                "reference": "7465b0c8564b34a5cfdadda21d63b91b8596ac76"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/TYPO3Fluid/Fluid/zipball/7465b0c8564b34a5cfdadda21d63b91b8596ac76",
+                "reference": "7465b0c8564b34a5cfdadda21d63b91b8596ac76",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.5.0"
+            },
+            "require-dev": {
+                "mikey179/vfsstream": "*",
+                "phpunit/phpunit": "*",
+                "satooshi/php-coveralls": "*"
+            },
+            "bin": [
+                "bin/fluid"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "TYPO3Fluid\\Fluid\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-3.0+"
+            ],
+            "description": "The TYPO3 Fluid template rendering engine",
+            "time": "2016-01-28 21:45:24"
         }
     ],
     "packages-dev": [
diff --git a/typo3/sysext/backend/Classes/ViewHelpers/AvatarViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/AvatarViewHelper.php
index 8e6e325ca3fd..7c694ace89fe 100644
--- a/typo3/sysext/backend/Classes/ViewHelpers/AvatarViewHelper.php
+++ b/typo3/sysext/backend/Classes/ViewHelpers/AvatarViewHelper.php
@@ -17,12 +17,11 @@ use TYPO3\CMS\Backend\Backend\Avatar\Avatar;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get avatar for backend user
  */
-class AvatarViewHelper extends AbstractViewHelper implements CompilableInterface
+class AvatarViewHelper extends AbstractViewHelper
 {
     /**
      * Resolve user avatar from backend user id.
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/Be/PagePathViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/Be/PagePathViewHelper.php
index d9fd3535d7ca..3f4d056df8f6 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/Be/PagePathViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/Be/PagePathViewHelper.php
@@ -15,14 +15,13 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Be;
  */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
  * Get page path string from page id
  * @internal
  */
-class PagePathViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class PagePathViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Resolve page id to page path string (with automatic cropping to maximum given length).
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php
index 41b4c8c01e7a..208b7df2987f 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php
@@ -17,14 +17,13 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
  * Display error icon from error integer value
  * @internal
  */
-class ErrorIconViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class ErrorIconViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Renders an error icon link as known from the TYPO3 backend.
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/Form/TranslateLabelSelectViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/Form/TranslateLabelSelectViewHelper.php
index 4557a4eb08c2..d37c1082b43e 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/Form/TranslateLabelSelectViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/Form/TranslateLabelSelectViewHelper.php
@@ -67,7 +67,7 @@ class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\S
             return '';
         }
         $labelKey = $this->hasArgument('optionLabelPrefix') ? $this->arguments['optionLabelPrefix'] . $label : $label;
-        $translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->controllerContext->getRequest()->getControllerExtensionName());
+        $translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->renderingContext->getControllerContext()->getRequest()->getControllerExtensionName());
         return $translatedLabel ?: $label;
     }
 }
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php
index f17eb677e1dc..866307fc6d9d 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php
@@ -17,13 +17,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
 use TYPO3\CMS\Belog\Domain\Model\LogEntry;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Create detail string from log entry
  * @internal
  */
-class FormatDetailsViewHelper extends AbstractViewHelper implements CompilableInterface
+class FormatDetailsViewHelper extends AbstractViewHelper
 {
     /**
      * Create formatted detail string from log row.
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
index b531d4352ad9..0d2e4ba01343 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
@@ -24,13 +24,12 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get history entry from for log entry
  * @internal
  */
-class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInterface
+class HistoryEntryViewHelper extends AbstractViewHelper
 {
     /**
      * Get system history record
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/IsExtensionLoadedViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/IsExtensionLoadedViewHelper.php
index 9d0258c585a1..c3e4f45e1341 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/IsExtensionLoadedViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/IsExtensionLoadedViewHelper.php
@@ -17,13 +17,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Returns true, if a specific extension is loaded
  * @internal
  */
-class IsExtensionLoadedViewHelper extends AbstractViewHelper implements CompilableInterface
+class IsExtensionLoadedViewHelper extends AbstractViewHelper
 {
     /**
      * Checks whether an extension is loaded.
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/UsernameViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/UsernameViewHelper.php
index 02751731cf22..a9f1a9298522 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/UsernameViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/UsernameViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get username from backend user id
  * @internal
  */
-class UsernameViewHelper extends AbstractViewHelper implements CompilableInterface
+class UsernameViewHelper extends AbstractViewHelper
 {
     /**
      * First level cache of user names
diff --git a/typo3/sysext/belog/Classes/ViewHelpers/WorkspaceTitleViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/WorkspaceTitleViewHelper.php
index e67af9428266..c36d8e3a9726 100644
--- a/typo3/sysext/belog/Classes/ViewHelpers/WorkspaceTitleViewHelper.php
+++ b/typo3/sysext/belog/Classes/ViewHelpers/WorkspaceTitleViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get workspace title from workspace id
  * @internal
  */
-class WorkspaceTitleViewHelper extends AbstractViewHelper implements CompilableInterface
+class WorkspaceTitleViewHelper extends AbstractViewHelper
 {
     /**
      * First level cache of workspace titles
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/ArrayElementViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/ArrayElementViewHelper.php
index b4c6c373332c..91de2da4327f 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/ArrayElementViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/ArrayElementViewHelper.php
@@ -16,12 +16,11 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get a value from an array by given key.
  */
-class ArrayElementViewHelper extends AbstractViewHelper implements CompilableInterface
+class ArrayElementViewHelper extends AbstractViewHelper
 {
     /**
      * Return array element by key. Accessed values must be scalar (string, int, float or double)
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php
index 45dd60834eaf..f47054d9a839 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Converts comma separated list of pages uids to html unordered list (<ul>) with speaking titles
  * @internal
  */
-class PagesViewHelper extends AbstractViewHelper implements CompilableInterface
+class PagesViewHelper extends AbstractViewHelper
 {
     /**
      * Render unordered list for pages
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php
index 1618ae7fadb0..4a876dd3d36e 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Converts comma separated list of sys_filemounts uids to html unordered list (<ul>) with speaking titles
  * @internal
  */
-class SysFileMountsViewHelper extends AbstractViewHelper implements CompilableInterface
+class SysFileMountsViewHelper extends AbstractViewHelper
 {
     /**
      * Render unordered list for sys_filemounts
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php
index 9043f9edf235..0ab1b72d23f8 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Converts comma separated list of sys_language uids to html unordered list (<ul>) with speaking titles
  * @internal
  */
-class SysLanguageViewHelper extends AbstractViewHelper implements CompilableInterface
+class SysLanguageViewHelper extends AbstractViewHelper
 {
     /**
      * Render unordered list for sys_language
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
index 8544b83ea87d..ca49b17f96b4 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
@@ -18,14 +18,13 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Edit Record ViewHelper, see FormEngine logic
  *
  * @internal
  */
-class EditRecordViewHelper extends AbstractViewHelper implements CompilableInterface
+class EditRecordViewHelper extends AbstractViewHelper
 {
     /**
      * Returns a URL to link to FormEngine
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
index 18a738a79ab6..50ebe984134d 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
@@ -19,13 +19,12 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Render a link to DataHandler command
  * @internal
  */
-class IssueCommandViewHelper extends AbstractViewHelper implements CompilableInterface
+class IssueCommandViewHelper extends AbstractViewHelper
 {
     /**
      * Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php
index e3e5a31d44e7..1dff8651378e 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Render permission icon group (user / group / others) of the "Access" module.
@@ -25,7 +24,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * Most of that could be done in fluid directly, but this view helper
  * is much better performance wise.
  */
-class PermissionsViewHelper extends AbstractViewHelper implements CompilableInterface
+class PermissionsViewHelper extends AbstractViewHelper
 {
     /**
      * @var array Cached labels for a single permission mask like "Delete page"
@@ -46,7 +45,7 @@ class PermissionsViewHelper extends AbstractViewHelper implements CompilableInte
     }
 
     /**
-     * Implementing CompilableInterface suppresses object instantiation of this view helper
+     * Static rendering method
      *
      * @param array $arguments
      * @param \Closure $renderChildrenClosure
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
index 9d4e951bccd7..7689d80a9548 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
@@ -23,14 +23,13 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Displays 'Delete user' link with sprite icon to remove user
  *
  * @internal
  */
-class RemoveUserViewHelper extends AbstractViewHelper implements CompilableInterface
+class RemoveUserViewHelper extends AbstractViewHelper
 {
     /**
      * Render link with sprite icon to remove user
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php
index e9437b0d3a4b..6ba9676b1a1c 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php
@@ -19,14 +19,13 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Domain\Model\BackendUser;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
  * Views sprite icon for a record (object)
  * @internal
  */
-class SpriteIconForRecordViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class SpriteIconForRecordViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Displays spriteIcon for database table and object
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php
index 839c2c7ae8e5..4513c82a4739 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php
@@ -21,13 +21,12 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Displays 'SwitchUser' link with sprite icon to change current backend user to target (non-admin) backendUser
  * @internal
  */
-class SwitchUserViewHelper extends AbstractViewHelper implements CompilableInterface
+class SwitchUserViewHelper extends AbstractViewHelper
 {
     /**
      * Render link with sprite icon to change current backend user to target
diff --git a/typo3/sysext/core/Classes/ViewHelpers/IconViewHelper.php b/typo3/sysext/core/Classes/ViewHelpers/IconViewHelper.php
index a0e295a8009e..dbdaf2e5d35c 100644
--- a/typo3/sysext/core/Classes/ViewHelpers/IconViewHelper.php
+++ b/typo3/sysext/core/Classes/ViewHelpers/IconViewHelper.php
@@ -20,12 +20,11 @@ use TYPO3\CMS\Core\Type\Icon\IconState;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Displays icon identified by icon identifier
  */
-class IconViewHelper extends AbstractViewHelper implements CompilableInterface
+class IconViewHelper extends AbstractViewHelper
 {
     /**
      * Prints icon html for $identifier key
diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php
index 5da23f9d50b2..4e7b6448f144 100644
--- a/typo3/sysext/core/Configuration/DefaultConfiguration.php
+++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php
@@ -181,7 +181,7 @@ return array(
                 ),
                 'fluid_template' => array(
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class,
-                    'frontend' => \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class,
+                    'frontend' => \TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class,
                     'groups' => array('system'),
                 ),
                 'extbase_object' => array(
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-ChangesInViewHelpersPostFluidStandalone.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-ChangesInViewHelpersPostFluidStandalone.rst
new file mode 100644
index 000000000000..d1d8f650ee33
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-ChangesInViewHelpersPostFluidStandalone.rst
@@ -0,0 +1,69 @@
+===============================================================
+Breaking: #69863 - changes in ViewHelpers post-standalone-Fluid
+===============================================================
+
+Description
+===========
+
+The following ViewHelpers have changed behaviours in Fluid:
+
+* The ``f:case`` ViewHelper does not support ``default`` argument any longer. To indicate which case is the default, use ``f:defaultCase``.
+* Tag content of ``f:render`` is no longer ignored and will be output if called with ``optional="1"``.
+* Arguments ``iconOnly`` and ``styleAttributes`` have been removed from ``f:be.buttons.csh``.
+* Argument ``alternateBackgroundColors`` has been removed from ``f:be.tableList``.
+* ViewHelpers no longer use the ``escapingInterceptorEnabled`` property but instead use ``escapeChildren`` and ``escapeOutput`` to control each behavior.
+
+The following ViewHelper classes are now only found in namespace ``TYPO3Fluid\Fluid\ViewHelpers`` and no longer exist in ``TYPO3\CMS\Fluid\ViewHelpers``:
+
+* ``TYPO3\CMS\Fluid\ViewHelpers\AliasViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\CommentViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\CycleViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\GroupedForViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\LayoutViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\SpacelessViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\Format\CdataViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\Format\PrintfViewHelper``
+* ``TYPO3\CMS\Fluid\ViewHelpers\Format\RawViewHelper``
+
+Impact
+======
+
+* A warning about use of an unregistered argument ``default`` will be displayed if templates contain ``f:case`` with ``default`` argument.
+* Unexpected template output will be output if templates are rendered which contain ``<f:render partial/section optional="1">will be output now</f:render>``.
+* A warning about use of an unregistered argument ``iconOnly`` and/or ``styleAttributes`` will be displayed if templates contain ``f:be.buttons.csh`` with either argument.
+* A warning about use of an unregistered argument ``alternateBackgroundColors`` will be displayed if templates contain ``f:be.tableList`` with that argument.
+* Any third-party ViewHelpers subclassing any of the classes listed above must change parent class to new namespace.
+* Any third-party ViewHelpers using ``escapingInterceptorEnabled`` property to disable escaping.
+
+
+Affected Installations
+======================
+
+Any TYPO3 instance that uses a template which contains:
+
+* An ``f:case`` with ``default`` argument.
+* An ``f:render`` with ``optional="1"`` and having content in the ``<f:render>`` tag.
+* An ``f:be.buttons.csh`` with either ``iconOnly`` or ``styleAttributes`` (value irrelevant).
+* An ``f:be.tableList`` with ``alternateBackgroundColors`` (value irrelevant).
+* Any third-party ViewHelper which subclasses any of the classes listed above.
+* Any third-party ViewHelper which uses ``escapingInterceptorEnabled`` property to disable escaping.
+
+
+Migration
+=========
+
+* Remove the ``default`` option and change ``f:case`` to ``f:defaultCase`` for that case.
+* Remove the tag contents of ``f:render``.
+* Remove arguments ``iconOnly`` and ``styleAttributes`` from ``f:be.buttons.csh`` where found.
+* Remove argument ``alternateBackgroundColors`` from ``f:be.tableList`` where found.
+* Update namespace of parent class in ViewHelpers subclassing any of the classes listed above.
+* Update ViewHelper class to use ``escapeChildren`` and/or ``escapeOutput`` depending on desired behavior.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-FluidEscapingBehaviourChangedFromENT_COMPATToENT_QUOTES.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-FluidEscapingBehaviourChangedFromENT_COMPATToENT_QUOTES.rst
new file mode 100644
index 000000000000..032e01112c92
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-FluidEscapingBehaviourChangedFromENT_COMPATToENT_QUOTES.rst
@@ -0,0 +1,26 @@
+=================================================================================
+Breaking: #69863 - Fluid escaping behaviour changed from ENT_COMPAT to ENT_QUOTES
+=================================================================================
+
+Description
+===========
+
+The escaping behaviour in Fluid has been changed. Before, ENT_COMPAT was used. Now, ENT_QUOTES is used.
+
+
+Impact
+======
+
+Fluid templates which depend on single quotes not being escaped when escaping variables. Affects ObjectAccessor (variable access in general) and calls to ``f:format.htmlentities`` and  ``f:format.htmlspecialchars``.
+
+
+Affected Installations
+======================
+
+Any TYPO3 site containing Fluid templates which depend on single quotes not being escaped.
+
+
+Migration
+=========
+
+Change template to not depend on single quotes being escaped in any ObjectAccessor, consider adding ``{variable -> f:format.htmlspecialchars(keepQuotes: 1)}`` or ``<f:format.htmlspecialchars keepQuotes="1">{variable}</f:format.htmlentities>`` when accessing variables but be aware of possible XSS implications due to incomplete escaping.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-RemovedDeprecatedCodeFromExtfluid.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-RemovedDeprecatedCodeFromExtfluid.rst
new file mode 100644
index 000000000000..e6a31fecffa7
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69863-RemovedDeprecatedCodeFromExtfluid.rst
@@ -0,0 +1,49 @@
+=========================================================
+Breaking: #69863 - Removed deprecated code from ext:fluid
+=========================================================
+
+Description
+===========
+
+Removed deprecated code from EXT:fluid
+
+The ChangeLog file has been removed.
+
+The renderMode option in ``FlashMessagesViewHelper`` has been removed.
+
+The following methods have been removed:
+
+``StandaloneView::setLayoutRootPath``
+``StandaloneView::getLayoutRootPath``
+``StandaloneView::setPartialRootPath``
+``StandaloneView::getPartialRootPath``
+``AbstractFormFieldViewHelper::getValue``
+
+The following class has been removed:
+
+``IconViewHelper``
+
+
+Impact
+======
+
+Using the methods above directly in any third party extension will result in a fatal error.
+
+Relying on the renderMode option might lead to different frontend output.
+
+
+Affected Installations
+======================
+
+Instances which use calls to the methods above, use the removed ``IconViewHelper or use the renderMode option in ``FlashMessagesViewHelper``.
+
+
+Migration
+=========
+
+For ``StandaloneView::setLayoutRootPath`` use ``StandaloneView::setLayoutRootPaths`` instead.
+For ``StandaloneView::getLayoutRootPath`` use ``StandaloneView::getLayoutRootPaths`` instead.
+For ``StandaloneView::setPartialRootPath`` use ``StandaloneView::setPartialRootPaths`` instead.
+For ``StandaloneView::getPartialRootPath`` use ``StandaloneView::setPartialRootPaths`` instead.
+
+For ``IconViewHelper`` use ``\TYPO3\CMS\Core\ViewHelpers\IconViewHelper`` instead.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69863-DeprecateGetTemplateVariableContainerFunction.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69863-DeprecateGetTemplateVariableContainerFunction.rst
new file mode 100644
index 000000000000..7a2f41952ee8
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69863-DeprecateGetTemplateVariableContainerFunction.rst
@@ -0,0 +1,26 @@
+=====================================================================
+Deprecation: #69863 - Deprecate getTemplateVariableContainer function
+=====================================================================
+
+Description
+===========
+
+``RenderingContext->getTemplateVariableContainer`` has been marked as deprecated in favor of getVariableProvider due to a changed concept for variable provisioning in standalone fluid. It now does more than just contain variables so a change in naming is necessary.
+
+
+Impact
+======
+
+Calling this method directly will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Any TYPO3 instance using ``getTemplateVariableContainer`` method directly within an extension or third-party code.
+
+
+Migration
+=========
+
+Use ``getVariableProvider`` instead of ``getTemplateVariableContainer``.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-69863-UseNewStandaloneFluidAsComposerDependency.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-69863-UseNewStandaloneFluidAsComposerDependency.rst
new file mode 100644
index 000000000000..b37a7d3575a6
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-69863-UseNewStandaloneFluidAsComposerDependency.rst
@@ -0,0 +1,361 @@
+=================================================================
+Feature: #69863 - Use new standalone Fluid as composer dependency
+=================================================================
+
+Description
+===========
+
+The Fluid rendering engine of TYPO3 CMS is replaced by the standalone capable Fluid which is now included as composer dependency.
+The old Fluid extension is converted to a so-called Fluid adapter which allows TYPO3 CMS to use standalone Fluid with the many
+new features this facilitates.
+
+
+Impact
+======
+
+New features/capabilities have been added in nearly all areas of Fluid. Most importantly: several of the Fluid components which
+in the past were completely internal and impossible to replace, are now easy to replace and have been fitted with a public API.
+Unless noted otherwise each feature below is part of such a new API component which you can replace. This gives you unprecedented
+control over almost all of Fluid's behaviours in a way that can be controlled via each View instance, for example from within a
+controller's initializeView method.
+
+Developers working with just the template side of Fluid will not notice many differences. Those that they will notice are, for
+the most part, hidden away beneath a compatibility flag that is set via the View, allowing each extension to opt-in to the
+extended capabilities or to stick with the legacy behaviour of Fluid. The new features that relate to these new behaviours are:
+
+RenderingContext
+----------------
+
+The most important new piece of public API is the RenderingContext. The previously internal-only RenderingContext used by Fluid
+has been expanded to be responsible for a vital new Fluid feature: implementation provisioning. This enables a developer to
+change a range of classes Fluid uses for parsing, resolving, caching etc. by either including a custom RenderingContext or
+manipulating the default RenderingContext by public methods, a developer is able to change a range of classes Fluid uses for
+parsing, resolving, caching etc.
+
+Each component which can be replaced this way is described in further detail below.
+
+Impact for template developers
+==============================
+
+The following behaviours can all be controlled by manipulating the RenderingContext. By default, none of them are enabled - but
+calling a simple method (via your View instance) allows you to enable them:
+
+.. code-block:: php
+
+	$view->getRenderingContext()->setLegacyMode(false);
+
+Doing so causes the RenderingContext to deliver different implementations, which simply means that in addition to what you
+already know Fluid to be capable of (variable access, inline syntax etc.) you gain access to the following features:
+
+ExpressionNodes
+---------------
+
+Expression Nodes are a new type of Fluid syntax structures which all share a common trait: they only work inside the curly braces
+previously only used by variable accessing and inline syntax of ViewHelpers. You can define the exact collection of
+ExpressionNodes that are active for your rendering process, via the View instance:
+
+.. code-block:: php
+
+	$view->getRenderingContext()->setExpressionNodeTypes(array(
+		'Class\Number\One',
+		'Class\Number\Two'
+	));
+
+When added to this collection these Expression Node types allow new syntaxes such as ``{myVariable + 1}`` or
+``{myArrayLikeObject as array}``. When the legacy mode toggle when set to ``false`` this will enable the following
+expression types:
+
+1. CastingExpressionNode - this type allows casting a variable to certain types, for example to guarantee an integer or a
+   boolean. It is used simply with an ``as`` keyword: ``{myStringVariable as boolean}``, ``{myBooleanVariable as integer}`` and
+   so on. Attempting to cast a variable to an incompatible type causes a standard Fluid error.
+2. MathExpressionNode - this type allows basic mathematical operations on variables, for example ``{myNumber + 1}``,
+   ``{myPercent / 100}``, ``{myNumber * 100}`` and so on. An impossible expression returns an empty output.
+3. TernaryExpressionNode - this type allows an inline ternary condition which only operates on variables. The use case is "if
+   this variable then use that variable else use another variable". It is used as
+   ``{myToggleVariable ? myThenVariable : myElseVariable}``. Note that it does not support any nested expressions, inline
+   ViewHelper syntaxes or similar inside it - it must be used only with standard variables as input.
+
+Developers can add their own additional ExpressionNodeTypes. Each one consists of a pattern to be matched and methods dictated
+by an interface to process the matches - any existing ExpressionNode type can be used as reference.
+
+Namespaces are extensible
+-------------------------
+
+Fluid now allows each namespace alias (for example ``f:``) to be extended by adding to it additional PHP namespaces that are
+also checked for the presence of ViewHelper classes. This is what allows TYPO3 CMS to transparently add just the ViewHelpers that
+are unique to TYPO3 CMS and let Fluid add the rest. It also means that developers can override individual ViewHelpers with custom
+versions and have their ViewHelpers called when the ``f:`` namespace is used.
+
+This change also implies that namespaces are no longer monadic - any time you use ``{namespace f=My\Extension\ViewHelpers}`` you
+will no longer receive an error with "namespace already registered". Fluid will instead add this PHP namespace and look for
+ViewHelpers there as well. Additional namespaces are checked from the bottom up, allowing the additional namespaces to override
+ViewHelper classes by placing them in the same scope (e.g. ``f:format.nl2br`` can be overridden with
+``My\Extension\ViewHelpers\Format\Nl2brViewHelper`` given the namespace registration example above.
+
+The behaviour is used both for legacy namespace registration in curly braces and the modern ``xmlns`` approach using a
+container HTML tag.
+
+Rendering using f:render
+------------------------
+
+This specific ViewHelper is fundamentally different in the standalone Fluid version - in the default (current) usage scenarios
+it behaves completely like you are used to, but has been fitted with some major impact features that you can use whenever you
+want to, in any template.
+
+There are two specific changes both documented in their respective commits:
+
+1. Default content (when section/partial is missing) now possible - https://github.com/TYPO3Fluid/Fluid/commit/cd67f9d974bc489058bde1c4272b480eb349da09
+2. Tag content of ``f:render`` can now be passed as a variable to the section/partial being rendered (essentially becoming a
+   wrapping/block strategy) - https://github.com/TYPO3Fluid/Fluid/commit/454121cba81baed4e3fe526412ff3e14f7c499a9
+
+All TagBasedViewHelpers natively support data- prefixed attributes
+------------------------------------------------------------------
+
+Simply put - any TagBasedViewHelper can now receive ``data-`` prefixed attributes without requiring those attributes to be
+declared by the ViewHelper. Any suffix can be used as long as the prefix is ``data-``.
+
+Complex conditional statements
+------------------------------
+
+As a forced new feature - which is backwards compatible - Fluid now supports any degree of complex conditional statements with
+nesting and grouping:
+
+.. code-block:: xml
+
+	<f:if condition="({variableOne} && {variableTwo}) || {variableThree} || {variableFour}">
+		// Done if both variable one and two evaluate to true, or if either variable three or four do.
+	</f:if>
+
+In addition, ``f:else`` has been fitted with an "elseif"-like behavior:
+
+.. code-block:: xml
+
+	<f:if condition="{variableOne}">
+		<f:then>Do this</f:then>
+		<f:else if="{variableTwo}">Do this instead if variable two evals true</f:else>
+		<f:else if="{variableThree}">Or do this if variable three evals true</f:else>
+		<f:else>Or do this if nothing above is true</f:else>
+	</f:if>
+
+Dynamic variable name parts
+---------------------------
+
+Another forced new feature, likewise backwards compatible, is the added ability to use sub-variable references when accessing
+your variables. Consider the following Fluid template variables array:
+
+.. code-block:: php
+
+	$mykey = 'foo'; // or 'bar', set by any source
+	$view->assign('data', ['foo' => 1, 'bar' => 2]);
+	$view->assign('key', $mykey);
+
+With the following Fluid template:
+
+.. code-block:: xml
+
+	You chose: {data.{key}}.
+	(output: "1" if key is "foo" or "2" if key is "bar")
+
+The same approach can also be used to generate dynamic parts of a string variable name:
+
+.. code-block:: php
+
+	$mydynamicpart = 'First'; // or 'Second', set by any source
+	$view->assign('myFirstVariable', 1);
+	$view->assign('mySecondVariable', 2);
+	$view->assign('which', $mydynamicpart);
+
+With the following Fluid template:
+
+.. code-block:: xml
+
+	You chose: {my{which}Variable}.
+	(output: "1" if which is "First" or "2" if which is "Second")
+
+This syntax can be used anywhere a variable is referenced, with one exception: variables passed as pure variable accessors cannot
+contain dynamic parts, e.g. the following will **NOT** work:
+
+.. code-block:: xml
+
+	{f:if(condition: my{which}Variable, then: 'this', else: 'that')}
+
+Whereas the following **will** work because the variables are accessed wrapped in a text node:
+
+.. code-block:: xml
+
+	{f:if(condition: '{my{which}Variable}', then: 'this', else: 'that')}
+
+In other words: unless your outer variable reference is enclosed with curly braces, Fluid does not detect that you are
+referencing a dynamic variable and will instead assume you meant a variable actually named ``my{which}Variable`` which was added
+as ``$view->assign('my{which}Variable', 'value')``.
+
+New ViewHelpers
+---------------
+
+A few new ViewHelpers have been added to the collection as part of standalone Fluid and as such are also available in TYPO3 from now on:
+
+* ``f:or`` which is a shorter way to write (chained) conditions. It supports syntax like
+  ``{variableOne -> f:or(alternative: variableTwo) -> f:or(alternative: variableThree)}`` which checks each variable and outputs
+  the first one that's not empty.
+* ``f:spaceless`` which can be used in tag-mode around template code to eliminate redundant whitespace and blank lines for
+  example caused by indenting ViewHelper usages.
+
+Improved error reporting
+------------------------
+
+Syntax errors or problems with required arguments or incorrect argument types will now be reported with line number and template
+code example from the line that fails. Any ViewHelper Exception is turned into this improved error type by converting it to a
+special syntax error and attaching the original Exception to it.
+
+An example error could be:
+
+``TYPO3Fluid\Fluid\Core\Parser\Exception: Fluid parse error in template Default_action_Default_1cb8dc11e29962882f629f79c0b9113ff33d6219,
+line 11 at character 3. Error: The ViewHelper "<f:serender>" could not be resolved. Based on your spelling, the system would load
+the class "TYPO3Fluid\Fluid\ViewHelpers\SerenderViewHelper", however this class does not exist. (1407060572). Template code:
+<f:serender section="Foo" optional="1">``. A stack trace is still included if TYPO3 does not run in Production context.
+
+Impact for extension developers
+===============================
+
+Extension developers are affected mainly by gaining access to a range of new APIs that control Fluid's behavior. These new APIs
+can all be accessed via the RenderingContext which is available in Views and ViewHelpers (also when compiled). Developers can
+provide custom implementations or manipulate the standard implementations by retrieving each API through the RenderingContext
+and using methods of those.
+
+There are no significant changes to best practices and the ViewHelper API (which you use when creating custom ViewHelpers)
+remains largely untouched. The most notable change is that ``$this->renderingContext`` in ViewHelpers and Views now allows direct
+access to on-the-fly changes in Fluid's behavior.
+
+RenderingContext as implementation API
+--------------------------------------
+
+Rather than just being a simple context which hangs on to variables, the RenderingContext has been given a completely new and
+even more vital role in Fluid - it is now the API for delivering custom implementations for a range of features that until now
+were only possible to achieve via means like XCLASSing. A RenderingContext now delivers the following components:
+
+* The VariableProvider (previously known as TemplateVariableContainer, see below) used in rendering
+* The ViewHelperVariableContainer (already known) used in rendering
+* The ViewHelperResolver (new pattern) responsible for handling namespaces and resolving/creating ViewHelper instances
+  and arguments
+* The ViewHelperInvoker (new pattern) responsible for calling ViewHelpers (circumvented when ViewHelpers implement a custom
+  ``compile()`` method)
+* The TemplatePaths (new pattern) which is a template file resolving class that now contains resolving methods previously found
+  on the View itself
+* The TemplateParser (already known) which is responsible for parsing the template and creating a ParsedTemplate
+* The TemplateCompiler (already known) which is responsible for converting a ParsedTemplate to a native PHP class
+* The FluidCache (new pattern) which is a custom caching implementation compatible with TYPO3 caching frontends/backends
+  storing PHP files
+* An array of ExpressionNodeTypes (class names, new pattern) - see description of those above
+* An array of TemplateProcessors (instances, new pattern) which pre-process template source code before it gets handed off to the
+  TemplateParser, allowing things like extracting registered namespaces in custom ways.
+* The controller name, if one applies to the context
+* The controller action name, if one applies to the context
+* And for TYPO3 CMS only, the Extbase ControllerContext (which is as it has always been; contains a Request etc.).
+
+All (!) of which can be replaced with custom implementations and all of which are accessible through View and ViewHelpers alike.
+Just a few of the capabilities you gain:
+
+* You can create custom VariableProvider implementations which retrieve variables in new ways from new sources - Fluid itself now
+  includes a JSON-based VariableProvider as well as a ChainedVariableProvider which allows "plugging" multiple variable sources.
+* You can create a custom ViewHelperResolver implementation which can do things like automatically register namespaces that are
+  always available or change the way ViewHelper classes are detected, instantiated, how arguments are detected, and more.
+* You can create a custom ViewHelperInvoker implementation which calls ViewHelpers in new ways - combined with a custom
+  ViewHelperResolver this can for example allow non-ViewHelper classes to be used as if they actually were ViewHelpers.
+* You can create custom TemplatePaths implementations which for example read template sources not from the local file system but
+  from database, remote storage, zip files, whatever you desire.
+* You can replace the TemplateParser itself (but be careful if you do, obviously). There are no current use cases for this, but
+  the possibility exists.
+* You can replace the TemplateCompiler (be careful here too). No use case exists but this could be used to compile Fluid
+  templates to other things than PHP.
+* You can replace the Cache implementation - for example to cache compiled Fluid templates in memcache or a distributed cache
+  accessible by PHP opcache.
+* You can change which Expression Node types are possible to use in templates rendered with your context, for example disabling
+  ternary expressions or adding a custom type of expression of your own.
+* You can change which TemplateProcessors will be used to process templates when rendered with your context, to do whatever you
+  like - transform, analyse and so on the template source.
+
+All of these parts are possible to replace via the provided RenderingContext - you don't necessarily have to create your own -
+but when creating multiple implementations it is often easier to combine those in a custom RenderingContext and just provide
+that for your View.
+
+But perhaps most importantly, because all of these components are contained in the RenderingContext which is available to Views
+and ViewHelpers alike (also once compiled!), it becomes possible for your View or ViewHelpers to actually interact with the Fluid
+environment in powerful ways. To illustrate how powerful, you could create a single ViewHelper which: manipulates the Expression
+Node types usable in its tag content, changes the paths used to resolve Partials, registers a number of other ViewHelper
+namespaces, changes the variable source to be a JSON file or URL and adds a pre-processing class that triggers on every template
+source read from within the ViewHelper's tag contents, to strip some undesired namespace from third party Partials. And it could
+restore the context afterwards so that all of this only applies inside that ViewHelper's tag content.
+
+ViewHelper namespaces can be extended also from PHP
+---------------------------------------------------
+
+By accessing the ViewHelperResolver of the RenderingContext, developers can change the ViewHelper namespace inclusions on a
+global (read: per View instance) basis:
+
+.. code-block:: php
+
+	$resolver = $view->getRenderingContext()->getViewHelperResolver();
+	// equivalent of registering namespace in template(s):
+	$resolver->registerNamespace('news', 'GeorgRinger\News\ViewHelpers');
+	// adding additional PHP namespaces to check when resolving ViewHelpers:
+	$resolver->extendNamespace('f', 'My\Extension\ViewHelpers');
+	// setting all namespaces in advance, globally, before template parsing:
+	$resolver->setNamespaces(array(
+		'f' => array(
+			'TYPO3Fluid\\Fluid\\ViewHelpers',
+			'TYPO3\\CMS\\Fluid\\ViewHelpers',
+			'My\\Extension\\ViewHelpers'
+		),
+		'vhs' => array(
+		    'FluidTYPO3\\Vhs\\ViewHelpers',
+		    'My\\Extension\\ViewHelpers'
+		),
+		'news' => array(
+			'GeorgRinger\\News\\ViewHelpers',
+		);
+	));
+
+By "extending" a namespace Fluid adds additional lookup namespaces when detecting ViewHelper classes and uses the last added path first, allowing you to replace ViewHelpers by placing a class with the same sub-name in your own ViewHelpers namespace that extends Fluid's. Doing so also allows you to change the arguments the ViewHelper accepts/requires.
+
+ViewHelpers can accept arbitrary arguments
+------------------------------------------
+
+This feature allows your ViewHelper class to receive any number of additional arguments using any names you desire. It works by
+separating the arguments that are passed to each ViewHelper into two groups: those that are declared using ``registerArgument``
+(or render method arguments), and those that are not. Those that are not declared are then passed to a special function -
+``handleAdditionalArguments`` - on the ViewHelper class, which in the default implementation throws an error if additional
+arguments exist. So by overriding this method in your ViewHelper you can change if and when the ViewHelper should throw an
+error on receiving unregistered arguments.
+
+This feature is also the one allowing TagBasedViewHelpers to freely accept arbitrary ``data-`` prefixed arguments without
+failing - on TagBased ViewHelpers, the ``handleAdditionalArguments`` method simply adds new attributes to the tag that gets
+generated and throws an error if any additional arguments which are neither registered nor prefixed with ``data-`` are given.
+
+ViewHelpers automatically compilable
+------------------------------------
+
+All ViewHelpers, including those you write yourself, are now automatically compilable. This means you no longer have to care
+about implementing the CompilableInterface or a custom ``compile()`` function, and that every Fluid template can now be cached
+to a compiled PHP script regardless of ViewHelpers.
+
+ViewHelpers still are able to define a custom ``compile()`` function but are no longer required to do so. When they don't define
+such a method, an execution is chosen which is identical in performance to calling the ViewHelper from a template that before
+this could not be compiled. The ViewHelpers that do define a custom compiling method can further increase performance.
+
+When you explicitly require a ViewHelper of yours to prevent template caching it is possible to implement a custom ``compile()``
+method which calls ``$templateParser->disable();` and nothing else. Doing this disables the compiling inside the scope (template,
+partial or section) currently being rendered.
+
+New and more efficient escaping
+-------------------------------
+
+Contrary to earlier versions of Fluid which used a ViewHelperNode for ``f:format.htmlentities`` around other nodes it wished to
+escape, standalone Fluid has implemented a custom SyntaxTreeNode type which does the escaping in a more efficient manner
+(directly using ``htmlentities``). Although it means you cannot override this escaping behaviour by overriding the
+``f:format.htmlentities`` ViewHelper (which is completely possible to do with Fluid now) it should mean a significant boost to
+performance as it avoids an excessive amount of ViewHelper resolving and -rendering operations, replacing them with a single PHP
+function call wrapped in a tiny class, which compiles also to a single function call and which compiles in a way that it wraps
+the compiled output of the Node it escapes as a pure string operation.
+
+Escaping interception is still contained within the ``Configuration`` instance given to the TemplateParser - and those can be
+manipulated with a custom RenderingContext (see above).
diff --git a/typo3/sysext/cshmanual/Classes/ViewHelpers/FormatViewHelper.php b/typo3/sysext/cshmanual/Classes/ViewHelpers/FormatViewHelper.php
index ce064360f2ad..1ed75510500e 100644
--- a/typo3/sysext/cshmanual/Classes/ViewHelpers/FormatViewHelper.php
+++ b/typo3/sysext/cshmanual/Classes/ViewHelpers/FormatViewHelper.php
@@ -16,14 +16,13 @@ namespace TYPO3\CMS\Cshmanual\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Format the given content
  *
  * @internal
  */
-class FormatViewHelper extends AbstractViewHelper implements CompilableInterface
+class FormatViewHelper extends AbstractViewHelper
 {
     /**
      * Disable the escaping interceptor
diff --git a/typo3/sysext/documentation/Classes/ViewHelpers/FormatsViewHelper.php b/typo3/sysext/documentation/Classes/ViewHelpers/FormatsViewHelper.php
index 7baad7a048ad..c2fba2dab9d2 100644
--- a/typo3/sysext/documentation/Classes/ViewHelpers/FormatsViewHelper.php
+++ b/typo3/sysext/documentation/Classes/ViewHelpers/FormatsViewHelper.php
@@ -19,7 +19,6 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * ViewHelper to display all download links for a document
@@ -28,7 +27,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class FormatsViewHelper extends AbstractViewHelper implements CompilableInterface
+class FormatsViewHelper extends AbstractViewHelper
 {
     /**
      * Renders all format download links.
diff --git a/typo3/sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php b/typo3/sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php
index 05e76daf5519..1e64ec701270 100644
--- a/typo3/sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php
+++ b/typo3/sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php
@@ -56,8 +56,8 @@ class DebuggerUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
             $parameters[$i] = $argument;
         }
 
-        /** @var $arguments \TYPO3\CMS\Fluid\Core\ViewHelper\Arguments */
-        $arguments = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\Arguments::class, array('dummy'), array('arguments' => $parameters));
+        /** @var $arguments \ArrayAccess */
+        $arguments = $this->getMock('ArrayAccess');
 
         $arguments->expects($this->never())->method('rewind');
         $this->debugger->var_dump($arguments, null, 8, true, false, true);
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php
index 921e414a68c9..4f78ac78c885 100644
--- a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php
+++ b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php
@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * View Helper for imploding arrays
  * @internal
  */
-class ImplodeViewHelper extends AbstractViewHelper implements CompilableInterface
+class ImplodeViewHelper extends AbstractViewHelper
 {
     /**
      * Implodes a string
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/JsonEncodeViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/JsonEncodeViewHelper.php
index 99084f06215b..cb3cb3ad6c1a 100644
--- a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/JsonEncodeViewHelper.php
+++ b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/JsonEncodeViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Wrapper for PHPs json_encode function.
@@ -24,7 +23,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * @see http://www.php.net/manual/en/function.json-encode.php
  * @internal
  */
-class JsonEncodeViewHelper extends AbstractViewHelper implements CompilableInterface
+class JsonEncodeViewHelper extends AbstractViewHelper
 {
     /**
      * Constructor
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/InstallationStateCssClassViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/InstallationStateCssClassViewHelper.php
index 8032747f7d2a..cfee8c62e16f 100644
--- a/typo3/sysext/extensionmanager/Classes/ViewHelpers/InstallationStateCssClassViewHelper.php
+++ b/typo3/sysext/extensionmanager/Classes/ViewHelpers/InstallationStateCssClassViewHelper.php
@@ -16,14 +16,13 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Returns a string meant to be used as css class stating whether an extension is
  * available or installed
  * @internal
  */
-class InstallationStateCssClassViewHelper extends AbstractViewHelper implements CompilableInterface
+class InstallationStateCssClassViewHelper extends AbstractViewHelper
 {
     /**
      * Returns string meant to be used as css class
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php
index bbad26d28bc3..b34f33cde293 100644
--- a/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php
+++ b/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Shows the elapsed time since the last update of the extension repository
@@ -24,7 +23,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class TimeSinceLastUpdateViewHelper extends AbstractViewHelper implements CompilableInterface
+class TimeSinceLastUpdateViewHelper extends AbstractViewHelper
 {
     /**
      * Render method
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Typo3DependencyViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Typo3DependencyViewHelper.php
index 2fefd16dd813..c8006b37c845 100644
--- a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Typo3DependencyViewHelper.php
+++ b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Typo3DependencyViewHelper.php
@@ -20,14 +20,13 @@ use TYPO3\CMS\Extensionmanager\Domain\Model\Dependency;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Shows the version numbers of the TYPO3 dependency, if any
  *
  * @internal
  */
-class Typo3DependencyViewHelper extends AbstractViewHelper implements CompilableInterface
+class Typo3DependencyViewHelper extends AbstractViewHelper
 {
     /**
      * Finds and returns the suitable TYPO3 versions of an extension
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
index d64b160af21d..07198b73a649 100755
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
@@ -18,12 +18,11 @@ use Closure;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Class DeleteFileViewHelper
  */
-class DeleteFileViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements CompilableInterface
+class DeleteFileViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
      * Renders a link to delete the file
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
index 3cb532bcd15b..c516ddbe041c 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
@@ -19,12 +19,11 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Class EditFileContentViewHelper
  */
-class EditFileContentViewHelper extends AbstractViewHelper implements CompilableInterface
+class EditFileContentViewHelper extends AbstractViewHelper
 {
     /**
      * Renders a link to edit the file content
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
index a068fa40e383..2275e287f34b 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
@@ -19,12 +19,11 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Class EditSysFileMetadataRecordViewHelper
  */
-class EditSysFileMetadataRecordViewHelper extends AbstractViewHelper implements CompilableInterface
+class EditSysFileMetadataRecordViewHelper extends AbstractViewHelper
 {
     /**
      * Renders a link to edit sys_file_metadata
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
index b4a45d211733..76f129562e3a 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
@@ -19,12 +19,11 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Class RenameFileViewHelper
  */
-class RenameFileViewHelper extends AbstractViewHelper implements CompilableInterface
+class RenameFileViewHelper extends AbstractViewHelper
 {
     /**
      * Renders a link to rename a file
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
index d7e823896be7..8fd0a10282ee 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
@@ -19,12 +19,11 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Class ReplaceFileViewHelper
  */
-class ReplaceFileViewHelper extends AbstractViewHelper implements CompilableInterface
+class ReplaceFileViewHelper extends AbstractViewHelper
 {
     /**
      * Renders a link to replace a file
diff --git a/typo3/sysext/fluid/ChangeLog b/typo3/sysext/fluid/ChangeLog
deleted file mode 100644
index c70402b66afa..000000000000
--- a/typo3/sysext/fluid/ChangeLog
+++ /dev/null
@@ -1,585 +0,0 @@
-This file is not maintained anymore and is only here for backwards compatibility
-@deprecated since TYPO3 CMS 7, this file will be removed in TYPO3 CMS 8
-================================================================================
-
-ChangeLog for Fluid
-===================
-
-Changes for 6.2
-===============
-
-!!! Image view helper does not render title tag by default
-
-In previous versions of fluid the image view helper always rendered the
-title attribute. If not set, the value of the required alt attribute was set as
-title.
-This fallback was removed with version 6.2. If not specifically set, title
-is not rendered anymore.
-
-Full Changes for 6.2
-====================
-
-[TASK] Move language include to .xlf
-[TASK] Replace inject methods with @inject
-[FEATURE] Improve BE container view helper
-[TASK] Remove Comment for deprecation of f:translate key
-[!!!][FEATURE] Backport recursive and allowing empty validation from Flow
-[BUGFIX] ShortcutVH must not ignore options.enableBookmarks
-[TASK] Remove last bits of forceCharset handling
-[FEATURE] ViewHelper to display file sizes
-[TASK] Move ExtJS- & JavaScript from t3lib
-[FEATURE] Switch View Helper
-[BUGFIX] FormFieldVH->getPropertyValue() must work without form object
-[BUGFIX] Enable CheckboxViewHelper binding to ArrayObject and Null
-[TASK] Remove mention of template.php
-[BUGFIX] Remove second registration of argument 'placeholder'
-[FEATURE] Add placeholder argument to VH for Textarea and Textfield
-[FEATURE] ImageViewHelper removed title fallback onto alt tag
-[BUGFIX] Mentions of old class names
-[TASK] Reschedule the removal for the old property mapper
-
-Changes for 6.1.0
-=================
-
-[!!!][FEATURE] Allow Fluid arrays only in ViewHelper arguments
---------------------------------------------------------------
-
-This change greatly enhances the JavaScript compatibility of Fluid.
-
-Fluid Arrays are a subset of the JavaScript object syntax, making it
-hard to work with them in mixed HTML/JavaScript documents. For example
-before this change, the following JavaScript Object was parsed by Fluid::
-
-	var uris = {
-	  endPoint1: '{f:uri.action(.)}',
-	  endPoint2: '{f:uri.action(.)}',
-	};
-
-Before this change, the above snippet resulted in the following template,
-as the generated array was casted to a string:
-
-	var uris = Array
-
-With this change, Fluid only parses arrays which are used inside
-ViewHelper arguments, such that an array inside normal text is not
-converted anymore.
-
-Breaking Change
-===============
-
-This change is only breaking in very rare cases where one relied on
-the inner contents of the ViewHelper being an array, f.e. if one used
-the debug ViewHelper as follows::
-
-	<f:debug>{key1: 'value1', key2: 'value2'}</f:debug>
-
-. or if anybody wrote custom ViewHelpers which use this convention.
-
-Relying on that would be very fragile anyways, as the insertion of a
-single space character before the opening curly bracket or after the
-closing one would cast the array back to a string.
-
-ViewHelpers which were written like this should be re-written to take
-the array as ViewHelper argument::
-
-	<f:debug value="{key1: 'value1', key2: 'value2'}" />
-
-Full Changes for 6.1.0
-======================
-
-[BUGFIX] Fluid must not use legacy flash message handling
-[BUGFIX] Don't use folders as templates, partials and layouts
-[TASK] Use __DIR__ instead of dirname(__FILE__)
-[TASK] Add namespaing to ConfigurationManagerInterface
-[TASK] Remove further t3lib mentions
-[TASK] Update t3lib mentions
-[TASK] Adjust Comments to describe string comparison
-[CLEANUP] Drop incomplete tests
-[BUGFIX] Add needed setting to handle file_references correctly
-[BUGFIX] Add needed setting to handle file_references correctly
-[TASK] Remove not maintained md5 in ext_emconf
-[BUGFIX] Incomplete mock reset in StandaloneViewTest
-[BUGFIX] FormViewHelper creates inline styling
-[BUGFIX] PHP 5.4 E_STRICT warning in HtmlViewHelper
-[TASK] Cleanup fluid
-[FEATURE] Adjustable decimals for view helper format.currency
-[TASK] Update examples in ValidationResults ViewHelper
-[TASK] Sync TYPO3 CMS Fluid with Flow Fluid 1.1 (part3)
-[TASK] Sync CMS Fluid with Flow Fluid 1.1 (part2)
-[TASK] Add test for GroupedForViewHelper to support DateTime Objects
-[TASK] Replace ObjectManager create with get
-[BUGFIX] Apply arguments to the default string
-[TASK] Clean up Unit tests in fluid
-[FEATURE] Complete the Property Mapper whitelist change for fluid
-[BUGFIX] Follow-up typo to #45316
-[TASK] Sync CMS Fluid with Flow Fluid 1.1 (part1)
-[FEATURE] Support literal strings in boolean arguments
-[TASK] Add dataproviders for 2 tests in DateViewHelperTest
-[BUGFIX] Skip a SelectViewHelperTest on Mac
-[BUGFIX] Unit test fails with broken timezone
-[BUGFIX] Wrong numbers in BE paginage widget
-[BUGFIX] Remove superfluous newline
-[BUGFIX] Date ViewHelper not using configured Timezones
-[BUGFIX] Fix typo and improve backup of system settings
-[FEATURE] Introduce prepend option for Select ViewHelper
-[BUGFIX] Remove PHP Error caused by setlocale call
-[BUGFIX] Incomplete locale backup in unit test
-[BUGFIX] selectViewHelper sorting should respect locales
-Revert "[TASK] Adjust failing test"
-[TASK] Adjust failing test
-[BUGFIX] Image viewhelper clears $GLOBALS['TSFE'] in backend context
-[TASK] Update version to 6.1.0-dev
-
-Changes for 1.4.0:
-==================
-included in TYPO3 4.6.0
-
-This change features numerous cleanups, and the following new features:
-
-Compilation of Fluid Templates to PHP files
--------------------------------------------
-
-This adds a compile step to the parsing process of templates, layouts and
-partials.
-If no compiled cache file exists, Fluid will create it while parsing the
-respective Fluid template.
-The cache file is invalidated as soon as the template/layout/partial
-has been modified (or if caches are flushed).
-This speeds up the rendering process by factor 2-5, and reduces memory
-consumption drastically.
-
-!!! $this->arguments->hasArgument() removed
--------------------------------------------
-
-AbstractViewHelper::$arguments are no longer an object but an array.
-
-If you used $this->arguments->hasArgument() in your custom ViewHelpers,
-you'll have to replace this with $this->hasArgument().
-
-THIS IS A BREAKING CHANGE.
-
-!!! Introduction of {_all} Variable
------------------------------------
-
-You can now use {_all} inside your template to access all variables available
-right now. This is especially helpful for debugging:
-
-    {_all -> f:debug()}
-
-or for passing all currently available variables to a partial:
-
-    <f:render partial="..." arguments="{_all}" />
-
-This is only a breaking change if you used a variable _all inside your own
-templates.
-
-Widgets: Allow overriding templateRootPath
-------------------------------------------
-It is now possible to override the widget template root path via the framework
-configuration, for example:
-
-    plugin.tx_extension.view {
-      widget.<WidgetViewHelperClassName>.templateRootPath=...
-    }
-
-Full Changes from 1.4.0 beta1 to 1.4.0:
-=======================================
-[TASK] Update version to 1.4.0-rc1
-[TASK] Increase version number
-[BUGFIX] Create new CObject in CObject ViewHelper
-[BUGFIX] Fix Doc comment in format.padding ViewHelper
-[BUGFIX] ViewHelper: Make SelectViewHelper use property paths as arguments
-[FEATURE] Add parameter to RenderViewHelper for optional sections
-[BUGFIX] Sanitize identifier when compiling templates
-[BUGFIX] use $for only when not empty and not NULL
-[+BUGFIX] disable cache when displaying FlashMessages in frontend
-[+FEATURE] Comment ViewHelper
-[TASK] Remove fluid autoloader
-[+TASK] Marking Fluid as "stable" instead of "beta"
-[+BUGFIX] Incorrect type of Error thrown (FLOW3 Error)
-[BUGFIX] Make textfield view helper handle zero (not empty) values
-
-Full Changes for 1.4.0 beta1:
-=============================
-
-[!!!][FEATURE] Compilation of Fluid templates to PHP files. Resolves: #28545
-[TASK] Minor cleanups
-[TASK] Tweak inline comment in TemplateView
-[!!!][+FEATURE] Add a reserved variable {_all} returning all template variables
-[BUGFIX] Deactivate EscapeInterceptor for certain ViewHelpers. Related: #27678
-[TASK] Split escape ViewHelper into dedicated format ViewHelpers. Related: #27628
-[BUGFIX] Whitespace fixes
-[FEATURE] IconViewHelper (BE) should support CSS-sprites. Resolves: #9957
-[TASK] Code Cleanup in TemplateView
-[+BUGFIX] Use of depreciated function debug in debugViewHelper. Fixes: #27970
-[BUGFIX] Fix Widget support. Resolves: #27783
-[TASK] Recreate ext_autoload.php. Related: #27680
-[+FEATURE] (ViewHelpers): Adjust Fluid to new Property Mapper. Related: #27656
-[+TASK] Fluid: Make use of newly introduced Extension Service. Related: #13864
-[+BUGFIX] Fix unit tests
-[TASK] Fluid: Use strpos() instead of strstr() where possible
-[TASK] Make TextboxViewHelper a subclass of TextFieldViewHelper
-[TASK] (ViewHelper): Code Cleanup to AbstractFormField ViewHelper
-[TASK] (Core): Code Cleanup in AbstractTagBasedViewHelper
-[+BUGFIX] (Core): Condition improvements. Resolves: #27557
-[TASK] Cleanup and small improvements to Interceptors
-[TASK] Comment and non-functional changes
-[+BUGFIX] Empty a tag ends with /> instead of </a>. Resolves: #27556
-[BUGFIX] Better error message for "unknown section" exception
-[+BUGFIX] Fluid (Core): Simplify debugging of exceptions thrown during render
-[+BUGFIX] Fluid: Fix CObjViewHelper. Fixes: #26138
-[+FEATURE] Widgets: Allow overriding templateRootPath. Thanks to Peter Bücker. Resolves: #10823
-[FEATURE] PaddingViewHelper: allow padding-type right/left/both. Resolves: #9283
-[BUGFIX] Fix documentation for BE-ViewHelpers. Resolves: #9942
-[~TASK] Update jQuery versions
-[+BUGFIX] CObjViewHelper: fixed using numeric values as data argument. Fixes: #12891
-[+BUGFIX] ActionMenuItemViewHelper: XHTML compliance in "selected" attribute value. Fixes: #8744
-[+BUGFIX] Fluid: CObjViewHelper fix deprecated call "getAccessibleProperties". Fixes: #26138
-[!!!][+TASK] Fluid v4 (Core): Make layout UpperCamelCase (with fallback)
-[~TASK] Fluid: Raising version from 1.3.0 to 1.4.0-devel
-[+FEATURE] Fluid (ViewHelpers): Add RawViewHelper
-[+FEATURE] Fluid v4 (Core): Set layoutName by variable
-
-
-
-Changes for 1.3.0:
-==================
-included in TYPO3 4.5.0 LTS.
-
-Here, only smaller bugs and inconsistencies have been fixed. For a description of bigger features, see below to the versions where they were introduced.
-
-Full Changes for 1.3.0:
-=======================
-
-[+TASK] Fluid (ViewHelpers): fixed typo in doc comment examples of emailViewhelper
-[+BUGFIX] Fluid (Tests): Fixed CropViewHelper unit test
-[+BUGFIX] Fixed comparison of Objects
-	Objects in comparison expressions were compared lazily
-	with == before this change. Now, they are compared with
-	===, which is the expected behavior on objects.
-[+TASK] Fluid (ViewHelpers): Extended inline documentation of FlashMessages ViewHelper
-[+BUGFIX] Fluid (Tests): Fixed Fluid unit tests!
-
-Changes for 1.3.0 RC1:
-======================
-included in TYPO3 4.5.0 RC1.
-
-This change contains numerous bugfixes, most notably fixes the Widget
-Bootstrap and the Standalone View (which is used in "FLUIDTEMPLATE").
-
-Full Changes for 1.3.0 RC1:
-===========================
-
-[+BUGFIX] Fluid (View): Fix StandaloneView
-	Since implementation of Dependency Injection the Fluid
-	Standalone view was broken in some cases, cause it did not
-	properly initialize all needed objects.
-	Fixes: #11520
-[+BUGFIX] Fluid (Core): Allow ViewHelpers to be placed in t3lib and tslib
-	The Fluid template parser does now recognize ViewHelpers inside t3lib/
-	or sysext/cms/tslib/, so Fluid can now be used inside the TYPO3 core.
-	Thanks to Andreas Wolf for the patch!
-	Resolves: #12061
-[+BUGFIX] Fluid (Widget): Adopt Widget Bootstrap to Extbase Bootstrap changes
-	Problem: The configureObjectManager method in Tx_Fluid_Core_Widget_Bootstrap
-	uses a call on a static method Tx_Extbase_Object_Container_Container::getContainer()
-	which doesn't exist anymore. The Container has become a t3lib_Singleton.
-	This patch changes the behavior, and makes it work again.
-	Thanks to Thomas Maroschik for the patch!
-	Resolves: #11991
-
-Changes for 1.3.0 Beta 4:
-=========================
-included in TYPO3 4.5.0 Beta 4.
-
-This change contains numerous bugfixes.
-
-Full Changes for 1.3.0 Beta 4:
-==============================
-
-[~TASK] Fluid (Tests): Fixed some testcase class names
-[+FEATURE] Fluid (ViewHelpers): prepend URIs with scheme if it's not specified in link.external / uri.external ViewHelpers. Resolves #10401
-[+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
-[+BUGFIX] Fluid (View): Fixed deprecation message about lowercase template files names
-
-Changes for 1.3.0 Beta 2:
-=========================
-included in TYPO3 4.5.0 Beta 2.
-
-The main change is the updating of the FlashMessage ViewHelper and concept:
-
-Since r3062 Extbase uses the t3lib_FlashMessageQueue to store flashmessages.
-Now you can output them including title and severity, making it possible
-to render flashmessages just like the ones from the core in BE mode.
-To keep backwards compatibility, the default rendering still outputs
-only the message bodies in an unordered list. Set the renderMode argument
-to "div" in order to display the new style:
-<f:flashMessages renderMode="div" />
-
-**********************************************************************************************
-*Extbase / Fluid 1.3.0 can now ONLY BE USED WITH TYPO3 4.5, as the older versions do not have*
-*the FlashMessageQueue available!                                                            *
-**********************************************************************************************
-
-Full Changes for 1.3.0 Beta 2:
-==============================
-[+BUGFIX] Fluid (ViewHelpers/Widget): widget.link and widget.uri no create relative URLs
-[+FEATURE] Fluid (ViewHelpers): Add render mode to FlashMessage ViewHelper
-[-TASK] Fluid: Removed all @scope annotations as they are not used in v4
-[+TASK] Fluid (View): Added additional check for deprecated lower case template filenames that works on case insensitive file systems (Windows) too. Watch your deprecation log in typo3conf and fix your template filenames if they're still lower case.
-[+BUGFIX]: explicitly cast offset to integer to avoid exceptions in paginate view helper
-
-
-Changes for 1.3.0 Beta 1a:
-==========================
-included in TYPO3 4.5.0 Beta 1.
-
-This Fluid Release contains the following main features, along with the usual bunch of bugfixes:
-
-* Fluid Widgets (see below)
-* Fluid Standalone View (in Fluid 1.3.0 Alpha 3, but has not been inside a TYPO3 Release yet)
-	In order to be able to use Fluid templates beyond the Extbase plugin context
-	(e.g. to render E-Mail templates or to use the new FLUIDTEMPLATE content object)
-	we created a new template view, that encapsulates inner workings and provides
-	an easy-to-use API:
-
-	$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
-	$view->setTemplatePathAndFilename('foo/Bar.html');
-	print $view->render();
-
-Fluid Widgets
--------------
-
-Widgets are special ViewHelpers which encapsulate complex functionality. It can be best understood
-what widgets are by giving some examples:
-* <f:widget.paginate> renders a Paginator, i.e. can be used to display large amounts of objects. This
-  is best known from search engines.
-* <f:widget.autocomplete> adds autocompletion functionality to a text field.
-* More widgets could include a Google Maps widget, a sortable grid, ...
-
-Internally, widgets consist of an own Controller and View part.
-
-Using widgets inside your templates is really simple: Just use them like standard ViewHelpers,
-and consult their documentation for usage examples. An example for the <f:widget.paginate> follows below:
-
-<f:widget.paginate itemsPerPage="10" objects="{blogs}" as="paginatedBlogs">
-	// use {paginatedBlogs} as you used {blogs} before, most certainly inside
-	// a <f:for> loop.
-</f:widget.paginate>
-
-In the above example, it looks like {blogs} contains all Blog objects, thus you might wonder if all
-objects were fetched from the database. However, the blogs are NOT fetched from the database until
-you actually use them, so the paginate ViewHelper will adjust the query sent to the database and
-receive only the small subset of objects. So, there is no negative performance overhead in using
-the Paginate Widget.
-
-For more details on how to write widgets, consult the Fluid manual, section "Fluid Widgets".
-
-Full Changes for 1.3.0 Beta 1a:
-===============================
-[+FEATURE] Fluid (ViewHelpers): the subject argument of the count ViewHelper is now optional so you can use it like {objects -> f:count()}
-[+BUGFIX] Fluid (ViewHelpers): Fixed inline documentation of widget.autocomplete ViewHelper. This fixes #10882
-[+TASK] Fluid (ViewHelpers): Added some more inline documentation for cObject, widget.paginate, widget.autocomplete & count ViewHelpers
-[+BUGFIX] Fluid (ViewHelpers): replaced two occurrences of Tx_Extbase_Dispatcher::*() by using the injected ConfigurationManager
-[+TASK] Fluid (ViewHelpers): uri.image now works in BE mode too
-[+BUGFIX] Fluid (ViewHelpers): Adjustment to skinning api change
-[+FEATURE] Fluid (ViewHelpers/Widget): Slightly improved paginate widget: The link to the first page now skips the currentPage argument resulting in nicer URLs and less cHashes
-[+FEATURE] Fluid (ViewHelpers): excluding obsolete widget arguments & cHash from widget links if they're not explicitly set
-[+BUGFIX] Fluid (Core/Widget): AjaxWidgetContextHolder now uses a unique id for the Ajax WidgetContext. This makes sure, that the ajax response gets the right context, even if you open multiple browser windows in the same session
-[+BUGFIX] Fluid (Core): The Fluid Widget Bootstrap now initializes the object manager in order to respect "config.tx_extbase.object" configuration.. TODO: this should be somehow refactored to avoid code duplication
-[+BUGFIX] Fluid: Reduced the typeNum for the fluidAjaxWidgetResponse page. Apparently 7076857368 was too large ;) TODO: the typeNum should be somehow configurable
-[~TASK] Fluid (ViewHelpers/Widget): removed $GLOBALS['TSFE']->additionalHeaderData call from AutocompleteViewHelper as this is not configurable like this. Moved the jQuery includes to Configuration/TypoScript/setup.txt which can be included in your main TS template
-[+BUGFIX] Fluid (ViewHelpers): Fixed Widget URI generation in widget.link/widget.uri ViewHelpers/Link/WidgetViewHelpers
-[~TASK] Fluid (ViewHelpers/Widget): Tweaked PaginateViewHelper: Minor refactoring of controller & template
-[-TASK] Fluid (Compatibility): Forgot to remove obsolete Tx_Fluid_Compatibility_ObjectManager in previous commit
-[+FEATURE] Fluid (Core/Widget): Added Tx_Fluid_Core_Widget_Bootstrap that is used to dispatch Ajax requests (see ext_typoscript_setup.txt).
-[~TASK] Fluid (Compatibility): Removed Tx_Fluid_Compatibility_ObjectManager and replaced instances by Tx_Extbase_Object_ObjectManagerInterface instances
-[~TASK] Fluid (Core/Widget): AbstractWidgetController has to be a singleton so it can be injected in the WidgetViewHelper.. To be discussed!
-[+TASK] Fluid (Core/Widget): AjaxWidgetContextHolder is now correctly stored in the BE/FE Users session if the ajaxWidget of the corresponding Widget is TRUE.
-[+TASK] Fluid (Core/Widget): The WidgetContext now contains a reference to the parent extension & plugin name. That's needed for the widgetAjaxResponse.
-[+BUGFIX] Fluid (Core/Widget): WidgetRequestBuilder now correctly interprets GET parameters and dispatches Ajax requests
-[+BUGFIX] Fluid (ViewHelpers): Modified ViewHelpers cObject, format.crop, format.html, image, uri.image so that they use dependency injection in order to retrieve the current cObject instance from the configurationManager
-[+BUGFIX] Fluid (ViewHelpers): Fixed form ViewHelper to respect configured pluginNamespace in field name prefixes
-[+BUGFIX] Fluid (ViewHelpers): link.widget/uri.widget ViewHelpers now create correct URIs
-[+BUGFIX] Fluid (ViewHelpers): replaced @inject annotation by injectController method in AutocompleteViewHelper.
-[+FEATURE] First step of "Fluid widget" backport
-	This is the first step of the Widget backport (#8773). This contains all the core classes that are required for the widget implementation and two exemplary Widget ViewHelpers "widget.paginate" and "widget.autocomplete".
-	Note: Ajax widgets are not yet working!!
-	Relates to: #8773
-	Relates to: #10568
-[!!!][+BUGFIX] Fluid (View): Adjust fluid to recent resolveView() backport
-	Tx_Fluid_View_AbstractTemplateView now implements the Tx_Extbase_MVC_View_ViewInterface that was changed in r2675.
-	NOTE: This is a breaking change because the API method Tx_Fluid_View_TemplateView::hasTemplate was renamed to canRender(). Besides I deleted the TemplateViewInterface that is no longer needed. Implement Tx_Extbase_MVC_View_ViewInterface or simply extend Tx_Fluid_View_AbstractTemplateView if you want to write your own view implementation
-	Relates to: #8990
-[+BUGFIX] Fluid: Adjust Fluid to Dependency Injection changes. Relates to: #9062
-
-Changes for 1.3.0 Alpha 3:
-==========================
-[+BUGFIX] Fluid (ViewHelpers): ImageViewHelper supports additionalAttributes argument
-	The image view helper did not call the parent constructor, which registeres the "additionalAttributes" argument. Thanks to Michael Knoll.
-[+FEATURE] Fluid (View): Fluid Standalone view (#10473)
-[+TASK] Fluid (ViewHelpers): Minor tweak in CObject ViewHelper
-	Make sure, that the configurationManager is initialized.
-	This is just a preliminary solution that will be replaced as soon
-	as the Extbase dispatcher refactoring (#7153) is done.
-
-Changes for 1.3.0 Alpha 2:
-==========================
-included in TYPO3 4.5.0 Alpha 2.
-
-In this release, mostly small bugfixes have been made in Fluid. Highlights are:
-
- * {settings} is now automatically in partials. (#6289)
-
- * You can now use <f:security.ifAuthenticated> and <f:security.ifHasRole role="foo"> (#9143)
-   in your Fluid templates to check whether an FE user is currently logged in / belongs to the
-   specified usergroup.
-   Note: if "role" is a numeric value the uid of the usergroup is compared, otherwise the title
-   of the usergroup.
-   To deal with BE users you can use the respective be.security.* view helpers
-
- * Boolean expressions can now contain negative numbers. Resolves #9434.
-
-Full Changes:
--------------
-
-[+FEATURE] Fluid (Core): {settings} is available in Partials
-Now, the {settings} are automatically available in partials and sections.
-Before, they had to be passed explicitely, i.e. by calling
-<f:render section="..." arguments="{settings: settings}" />.
-If somebody defined his own "settings"-argument, this still takes precedence:
-<f:render section="..." arguments="{settings: some.different.settings}" />
-This means that this change is completely backwards compatible.
-NOTE: The settings are NOT merged together, like it has been suggested in #6289,
-as this will lead to un-obvious behavior for the user.
-
-[-API] Fluid (Core): Remove getTemplateParser() method.
-This method has accidentally gotten an @api annotation,
-and was only needed for the Viewhelpertest package.
-Now, this package is cleaned up, and this method can be
-completely thrown away.
-
-[+BUGFIX] Fluid (ViewHelpers): Fix bug in Form ViewHelper
-Since #6521 you can use the "objectName" argument to specify the name of a bound object rather then using the "name" attribute.
-But if you do so, the rendered hidden identity field is not correct anymore. This behavior is fixed with this commit.
-Resolves: #9515
-
-* Documentation Cleanup
-
-[+FEATURE] Fluid (ViewHelpers): Backported ifAuthenticated & ifHasRole security ViewHelpers
-you can now use <f:security.ifAuthenticated> and <f:security.ifHasRole role="foo">
-in your Fluid templates to check whether an FE user is currently logged in / belongs to the
-specified usergroup.
-Note: if role is a numeric value the uid of the usergroup is compared, otherwise the title
-of the usergroup.
-to deal with BE users you can use the respective be.security.* view helpers
-Resolves #9143
-
-[TASK] Fluid (Core): Regular Expression performance improvements
-In rare cases, on some systems (like mine), the
-PCRE parser reproducably crashes if one passes very
-long argument strings into it, or very complex ones.
-With this patch, the parser is slightly modified
-to decrease the use of backtracking; which then avoids
-the crashes mostly.
-
-[TASK] Fluid (Core): Formatted Regular Expressions more nicely
-There were some undocumented regular expressions
-in the parser, which needed to be formatted nicely.
-
-[+BUGFIX] Fluid (Core): Boolean expressions can now contain negative numbers. Resolves #9434.
-Boolean expressions with negative numbers did not work so far.
-Now, they work as expected. Example from Viewhelpertest which displayed
-a wrong result before, and now displays the correct result:
-<f:if condition="{testVariables.number.minusOne} < -1.1">
-	<f:then>Then part!</f:then>
-	<f:else>Else part!</f:else>
-</f:if>
-Issue: #9434
-
-
-
-Changes for 1.3.0 Alpha 1
-=========================
-included in TYPO3 4.5.0 Alpha 1.
-
-In this release, numerous bugs have been fixed, making Fluid more stable than ever. Below are some nice features which have been introduced:
-
-* Instead of <f:form name="...">, you should now write write <f:form objectName="...">, to create an XHTML compliant form (#6521)
-
-* The <f:for>-ViewHelper has now Iteration Information available, if you want that:
-  <f:for each="{objects}" as="object" iteration="iteration">
-     {iteration.index} is a counter which starts at 0
-     {iteration.cycle} is a counter which starts at 1
-     {iteration.isEven} / {iteration.isOdd} is a boolean variable which is true if the index is even/odd
-     {iteration.isFirst} / {iteration.isLast} is a boolean variable which is true if it is the first or last element in the list.
-  </f:for>
-
-!!! Refactored all Condition-ViewHelpers like f:if, f:security.if* to use a newly created base class F3\Fluid\Core\ViewHelper\ConditionViewHelper. This greatly simplifies the implementation of custom conditions.
-  THIS IS A BREAKING CHANGE in case you copied the f:if ViewHelper to create a custom condition ViewHelper, as the internal workings changed. Please check the new f:if ViewHelper to see how to adjust your ViewHelper -- you basically just have to throw away a lot of code. Resolves #8824.
-
-* Fixed section, partial and layout rendering to function in all cases as expected now, and tested this behavior also.
-  !!! Removed renderSection() and renderWithLayout() from public API in Tx_Fluid_View_TemplateView, as this should only be called from inside Fluid.
-
-* Fixing checkbox, radio and select-ViewHelpers, but this task is not finished yet.
-  !!! The value argument is required again in form.checkbox and form.radio ViewHelpers. This is a breaking change, as the value argument has not been mandatory for a while. But it probably won't break existing templates as omitting the value makes no sense at all.
-
-* Fixed BE support of ViewHelpers (cObject, format.crop, uri.resource, format.html, image)
-
-* Negative numeric values are now properly converted to FALSE when used in boolean ViewHelper arguments.
-
-* added f:uri.image ViewHelper, working just like f:image, but returning the URL and not the full image tag.
-
-Full Changes:
--------------
-[~TASK] Fluid: Changed version of Extbase dependency from '1.2.0-1.2.999' to '1.3.0.devel' to reflect the version scheme defined in the wiki. Relates to #9152.
-[+BUGFIX] Fluid (View): AbstractTemplateView now correctly implements F3\FLOW3\MVC\View\ViewInterface and assign() and assignMultiple() will return an instance of $this to allow chaining again like $this->view->assign()->assign()... This fixes #9090 (backported from Fluid package r4931)
-[~TASK] Fluid (Tests): committing modified AbstractFormFieldViewHelperTest that I forgot to add in previous commit
-[+TASK] Fluid (ViewHelpers): Small performance improvement in ForViewHelper: Objects will only be converted to arrays if reverse is TRUE. Relates to #8732 (backported from Fluid package r4907)
-[+TASK] Fluid (View): Added getter for template parser to AbstractTemplateView. This is useful if you want to use the parser from within your custom ViewHelper (creating a new instance would skip interceptor registration) (backported from Fluid package r4907)
-[~TASK] Fluid (ViewHelpers): Added argument "objectName" to form ViewHelper. This is now the recommended way to specify the name of the object that is bound to a form! If objectName is not specified, the name attribute will be used as object name for backwards-compatibility reasons. This resolves #6521 (backported from Fluid package r4905)
-* Raised Fluid version in trunk to 1.3.0-devel
-[+BUGFIX] Fluid (ViewHelpers): Fixed a possible security issue where the content inside the Fluid a is not properly HTML escaped.
-[+FEATURE] Fluid (ViewHelpers): Added iteration information to for ViewHelper. Thanks to all the contributors for your input and patches! This resolves #6149 (backported from Fluid package r4904)
-[~TASK] Fluid (ViewHelpers): Fresh backport from Fluid package r4899 (Mostly fixed typos. slightly improved count ViewHelper)
-[~TASK] Fluid (ViewHelpers): Replaced custom convertToArray() method by PHPs iterator_to_array() function in cycle, for and groupedFor ViewHelpers. This resolves #8732. (backport from Fluid package r4898)
-[+BUGFIX] Fluid (ViewHelpers): Now, it is possible to "unselect" checkboxes and multiselect fields in editing forms. This fixes #5638. This fixes #8535. This fixes #6897 (improved forward-backport from Fluid package r4874)
-[+TASK] Fluid (Tests): Backported FormViewHelperTest from Fluid package
-[+BUGFIX] Fluid (ViewHelpers): FormViewHelper wraps hidden fields with a div tag to create XHTML valid output. This fixes #5512 (backported from Fluid package)
-[~TASK] Fluid (ViewHelpers): Fixed BE support of the ViewHelpers cObject, format.crop, uri.resource. Relates to #8947
-[~TASK] Fluid (ViewHelpers): Added BE support in the ViewHelpers format.html and image. Relates to #8947
-[!!!][+TASK] Fluid (ViewHelpers): The value argument is required again in form.checkbox and form.radio ViewHelpers. This is a breaking change, as the value argument has not been mandatory for a while. But it probably won't break existing templates as omitting the value makes no sense at all. Relates to #8852 (backported from Fluid package r4864)
-[+FEATURE] Fluid (Core): implemented overrideArgument() method in AbstractViewHelper to be able to override previously registered arguments in subclasses. This resolves #8852 (backported from Fluid package r4864)
-[+BUGFIX] Fluid (Core): Negative numeric values are properly converted to FALSE when used in boolean ViewHelper arguments. This resolves #8893 (backported from Fluid package r4864)
-[+BUGFIX] Fluid (ViewHelpers): Reversed the rendering order of header and childNodes in be.container ViewHelper to enable child nodes to modify the pageRenderer. This resolves #8880 (thanks to Andreas Wolf)
-[+BUGFIX] Fluid: Removed leading slash from @var annotations that were backported by mistake
-[+BUGFIX] Fluid: Replaced SplObjectStorage by Tx_Extbase_Persistence_ObjectStorage to be PHP 5.2-compatible (which ships with a broken implementation of SplObjectStorage)
-[!!!][~TASK] Fluid (Core): Renamed ConditionViewHelper and TagBasedViewHelper to Abstract*ViewHelper as per CGL. (backported from Fluid package r4840). To be backwards-compatible, TagBasedViewHelper.php still exists and will write an entry to TYPO3s deprecation log if used. Please adapt your custom ViewHelpers and inherit from AbstractTagBasedViewHelper instead of TagBasedViewHelper. This resolves #8834
-[~TASK] Fluid: Marked vfs unit tests to be skipped, as vfs is not part of v4 (yet)
-[-TASK] Fluid: Removed @package/@subpackage annotations from all Fluid classes. They have already been removed in FLOW3 packages in r2813.
-[-TASK] Fluid: Removed @version annotation from all Fluid classes to ease the backporting process. Relates to #8835 (backported from Fluid package)
-[+BUGFIX] Fluid (View): fixed method signature of AbstractTemplateView:getTemplateSource() that was different from the concrete implementation (backported from Fluid package)
-Fluid in v5 and v4 are now synchronized again!
-[+FEATURE] Fluid: The TemplateVariableContainer now provides a method to retrieve all variables.
-[~TASK] Fluid (Core): Introduced a RenderingContextInterface to more cleanly decouple Fluid's rendering context from the TypoScript rendering context. Note that view helpers (and other code) should now refer to that interface instead of the concrete Fluid implementation!
-[!!!][+BUGFIX] Fluid (Core): Refactored all Condition-ViewHelpers like f:if, f:security.if* to use a newly created base class F3\Fluid\Core\ViewHelper\ConditionViewHelper. This greatly simplifies the implementation of custom conditions. However, THIS IS A BREAKING CHANGE in case you copied the f:if ViewHelper to create a custom condition ViewHelper, as the internal workings changed. Please check the new f:if ViewHelper to see how to adjust your ViewHelper -- you basically just have to throw away a lot of code. Resolves #8824.
-[!!!][-API] Fluid (TemplateView): Removed renderSection() and renderWithLayout() from public API in Tx_Fluid_View_TemplateView, as this should only be called from inside Fluid.
-[!!!][TASK] Fluid (ViewHelpers): the <f:section />-ViewHelper now does NOT render itself anymore when encountered in a normal template. Example: Before the change, the template "before <f:section name='...'> middle </f:section> after" was rendered as "before middle after", but now it is only rendered as "before after". Although this is a breaking change, it is quite unlikely that anybody relied on this behavior, as it was inconsistent beforehand.
-[TASK] Fluid (TemplateView): Major refactoring of the layout, partial and section rendering mechanism. This also induces a speedup as retundant rendering is eliminated.
-[+FEATURE] Fluid (ViewHelpers): The <f:render>-ViewHelper can be now used to render sections in the same partial and template. In these cases, all arguments need to be specified explicitely. Additionally, it can now be used to render a section recursively.
-[~TASK] Fluid (Core): Removed some non-API-methods which were never called.
-[+FEATURE] Fluid (ViewHelpers): format.crop ViewHelper now supports all features in Backend mode. Relates to #8648
-[+TASK] Fluid: Set dependency to Extbase 1.2.x in ext_emconf.php to avoid confusions when working with different versions
-[+TASK] Fluid: Backported recent changes from Fluid package:
-[+FEATURE] Fluid (ViewHelpers): added "selectAllByDefault" argument to form.select ViewHelper. Resolves #4984
-~TASK] Fluid (Parser): Got rid of the constructor in Parser\Configuration.
-[+FEATURE] Fluid (ViewHelpers): Added uri.image ViewHelper. This resolves #8233
-[+FEATURE] Fluid (ViewHelpers): Added URI options noCache, noCacheHash, section, format, additionalParams, absolute, addQueryString & argumentsToBeExcludedFromQueryString to FormViewHelper. Resolves #8247 [+BUGFIX] Fluid: Removed a leading backslash in ViewHelperBaseTestcase that led to an error with PHP < 5.3
-[+TASK] Fluid: Backported some recent Fluid changes (Note: this is not a complete backport, there are still changes in Fluid Package that are not backported yet):
-[+BUGFIX] Fluid (ViewHelpers): form.select ViewHelper did only check whether "multiple" attribute was set and not whether it was empty or not. Resolves #5879
-[+FEATURE] Fluid (ViewHelpers): GroupedForViewHelper can now group by object. Resolves #7389
-
-
-HOW TO CREATE THE CHANGELOG
-===========================
-git log [startRevision]..HEAD --pretty=format:"%s%n%b%n" | grep -v "^$" | grep -v "git-svn-id"
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php b/typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
deleted file mode 100644
index b09225248c35..000000000000
--- a/typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Compatibility;
-
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
-/**
- * Class extending the docbook generator service for use in typo3 v4.
- *
- * Usage in TypoScript:
- *
- * config.disableAllHeaderCode = 1
- * page = PAGE
- * page.10 = USER_INT
- * page.10.userFunc = \TYPO3\CMS\Fluid\Compatibility\DocbookGeneratorService->userFunc
- *
- * @internal
- */
-class DocbookGeneratorService extends \TYPO3\CMS\Fluid\Service\DocbookGenerator
-{
-    /**
-     *
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     */
-    protected $objectManager;
-
-    /**
-     * User function
-     *
-     * @return string
-     */
-    public function userFunc()
-    {
-        $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $this->injectDocCommentParser($this->objectManager->get(\TYPO3\CMS\Extbase\Reflection\DocCommentParser::class));
-        $this->injectReflectionService($this->objectManager->get(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class));
-        return $this->generateDocbook(\TYPO3\CMS\Fluid\ViewHelpers::class);
-    }
-
-    /**
-     * Get class names within namespace
-     *
-     * @param string $namespace
-     * @return array
-     */
-    protected function getClassNamesInNamespace($namespace)
-    {
-        $namespaceParts = explode('\\', $namespace);
-        if ($namespaceParts[count($namespaceParts) - 1] == '') {
-        }
-        $classFilePathAndName = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(\TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($namespaceParts[2])) . 'Classes/';
-        $classFilePathAndName .= implode(array_slice($namespaceParts, 3, -1), '/') . '/';
-        $classNames = array();
-        $this->recursiveClassNameSearch($namespace, $classFilePathAndName, $classNames);
-        sort($classNames);
-        return $classNames;
-    }
-
-    /**
-     * Search recursivly class names within namespace
-     *
-     * @param string $namespace
-     * @param string $directory
-     * @param array $classNames
-     * @return void
-     */
-    private function recursiveClassNameSearch($namespace, $directory, &$classNames)
-    {
-        $dh = opendir($directory);
-        $counter = 0;
-        while (($file = readdir($dh)) !== false) {
-            if ($file == '.' || $file == '..' || $file == '.svn') {
-                continue;
-            }
-            if (is_file($directory . $file)) {
-                if (substr($file, 0, 8) == 'Abstract') {
-                    continue;
-                }
-                $classNames[] = $namespace . substr($file, 0, -4);
-            } elseif (is_dir($directory . $file)) {
-                $this->recursiveClassNameSearch($namespace . $file . '\\', $directory . $file . '/', $classNames);
-            }
-        }
-        closedir($dh);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php b/typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
deleted file mode 100644
index 1a93cfcdd9e8..000000000000
--- a/typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Compatibility;
-
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-/**
- * Build a template parser.
- * Use this class to get a fresh instance of a correctly initialized Fluid template parser.
- */
-class TemplateParserBuilder
-{
-    /**
-     * Creates a new TemplateParser which is correctly initialized. This is the correct
-     * way to get a Fluid parser instance.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\TemplateParser A correctly initialized Template Parser
-     */
-    public static function build()
-    {
-        /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
-        $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $templateParser = $objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class);
-        return $templateParser;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php b/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php
new file mode 100644
index 000000000000..e98c28191b4b
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php
@@ -0,0 +1,63 @@
+<?php
+namespace TYPO3\CMS\Fluid\Core\Cache;
+
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Cache\Exception\InvalidDataException;
+use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
+use TYPO3Fluid\Fluid\Core\Cache\FluidCacheInterface;
+
+/**
+ * Class FluidTemplateCache
+ *
+ * Connector class that enables the TYPO3 cache called "fluid_template" to be operated with the
+ * interface appropriate for the Fluid engine.
+ */
+class FluidTemplateCache extends PhpFrontend implements FluidCacheInterface
+{
+    /**
+     * @param null $name
+     * @return void
+     */
+    public function flush($name = null)
+    {
+        parent::flush();
+    }
+
+    /**
+     * @param string $entryIdentifier
+     * @return mixed
+     */
+    public function get($entryIdentifier)
+    {
+        return $this->requireOnce($entryIdentifier);
+    }
+
+    /**
+     * @param string $entryIdentifier
+     * @param string $sourceCode
+     * @param array $tags
+     * @param int $lifetime
+     * @throws InvalidDataException
+     */
+    public function set($entryIdentifier, $sourceCode, array $tags = array(), $lifetime = null)
+    {
+        if (strpos($sourceCode, '<?php') === 0) {
+            // Remove opening PHP tag; it is added by the cache backend to which
+            // we delegate and would be duplicated if not removed.
+            $sourceCode = substr($sourceCode, 6);
+        }
+        parent::set($entryIdentifier, $sourceCode, $tags, time() + 86400);
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/Core/Compiler/AbstractCompiledTemplate.php b/typo3/sysext/fluid/Classes/Core/Compiler/AbstractCompiledTemplate.php
deleted file mode 100644
index bda2964d0ab0..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Compiler/AbstractCompiledTemplate.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Compiler;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * Abstract Fluid Compiled template.
- *
- * INTERNAL!!
- */
-abstract class AbstractCompiledTemplate implements \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface
-{
-    /**
-     * @var array
-     */
-    protected $viewHelpersByPositionAndContext = array();
-
-    // These tokens are replaced by the Backporter for implementing different behavior in TYPO3 v4
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\Container\Container
-     */
-    protected static $objectContainer;
-
-    /**
-     * @var string
-     */
-    protected static $defaultEncoding = null;
-
-    /**
-     * Public such that it is callable from within closures
-     *
-     * @param int $uniqueCounter
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @param string $viewHelperName
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
-     * @internal
-     */
-    public function getViewHelper($uniqueCounter, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext, $viewHelperName)
-    {
-        if (self::$objectContainer === null) {
-            self::$objectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class);
-        }
-        if (isset($this->viewHelpersByPositionAndContext[$uniqueCounter])) {
-            if ($this->viewHelpersByPositionAndContext[$uniqueCounter]->contains($renderingContext)) {
-                $viewHelper = $this->viewHelpersByPositionAndContext[$uniqueCounter][$renderingContext];
-                $viewHelper->resetState();
-                return $viewHelper;
-            } else {
-                $viewHelperInstance = self::$objectContainer->getInstance($viewHelperName);
-                if ($viewHelperInstance instanceof \TYPO3\CMS\Core\SingletonInterface) {
-                    $viewHelperInstance->resetState();
-                }
-                $this->viewHelpersByPositionAndContext[$uniqueCounter]->attach($renderingContext, $viewHelperInstance);
-                return $viewHelperInstance;
-            }
-        } else {
-            $this->viewHelpersByPositionAndContext[$uniqueCounter] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
-            $viewHelperInstance = self::$objectContainer->getInstance($viewHelperName);
-            if ($viewHelperInstance instanceof \TYPO3\CMS\Core\SingletonInterface) {
-                $viewHelperInstance->resetState();
-            }
-            $this->viewHelpersByPositionAndContext[$uniqueCounter]->attach($renderingContext, $viewHelperInstance);
-            return $viewHelperInstance;
-        }
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCompilable()
-    {
-        return false;
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCompiled()
-    {
-        return true;
-    }
-
-    /**
-     * @return string
-     * @internal
-     */
-    public static function resolveDefaultEncoding()
-    {
-        if (static::$defaultEncoding === null) {
-            static::$defaultEncoding = 'UTF-8';
-        }
-        return static::$defaultEncoding;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php b/typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php
deleted file mode 100644
index bafc5d2d34d1..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php
+++ /dev/null
@@ -1,430 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Compiler;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-class TemplateCompiler implements \TYPO3\CMS\Core\SingletonInterface
-{
-    const SHOULD_GENERATE_VIEWHELPER_INVOCATION = '##should_gen_viewhelper##';
-
-    /**
-     * @var \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
-     */
-    protected $templateCache;
-
-    /**
-     * @var int
-     */
-    protected $variableCounter = 0;
-
-    /**
-     * @var array
-     */
-    protected $syntaxTreeInstanceCache = array();
-
-    /**
-     * @param \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend $templateCache
-     * @return void
-     */
-    public function setTemplateCache(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend $templateCache)
-    {
-        $this->templateCache = $templateCache;
-    }
-
-    /**
-     * @param string $identifier
-     * @return bool
-     */
-    public function has($identifier)
-    {
-        $identifier = $this->sanitizeIdentifier($identifier);
-        return $this->templateCache->has($identifier);
-    }
-
-    /**
-     * @param string $identifier
-     * @return \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface
-     */
-    public function get($identifier)
-    {
-        $identifier = $this->sanitizeIdentifier($identifier);
-        if (!isset($this->syntaxTreeInstanceCache[$identifier])) {
-            $this->templateCache->requireOnce($identifier);
-            $templateClassName = 'FluidCache_' . $identifier;
-            $this->syntaxTreeInstanceCache[$identifier] = new $templateClassName();
-        }
-        return $this->syntaxTreeInstanceCache[$identifier];
-    }
-
-    /**
-     * @param string $identifier
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState
-     * @return void
-     */
-    public function store($identifier, \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState)
-    {
-        $identifier = $this->sanitizeIdentifier($identifier);
-        $this->variableCounter = 0;
-        $generatedRenderFunctions = '';
-
-        if ($parsingState->getVariableContainer()->exists('sections')) {
-            $sections = $parsingState->getVariableContainer()->get('sections');
-            // @todo refactor to $parsedTemplate->getSections()
-            foreach ($sections as $sectionName => $sectionRootNode) {
-                $generatedRenderFunctions .= $this->generateCodeForSection($this->convertListOfSubNodes($sectionRootNode), 'section_' . sha1($sectionName), 'section ' . $sectionName);
-            }
-        }
-        $generatedRenderFunctions .= $this->generateCodeForSection($this->convertListOfSubNodes($parsingState->getRootNode()), 'render', 'Main Render function');
-        $convertedLayoutNameNode = $parsingState->hasLayout() ? $this->convert($parsingState->getLayoutNameNode()) : array('initialization' => '', 'execution' => 'NULL');
-
-        $classDefinition = 'class FluidCache_' . $identifier . ' extends \\TYPO3\\CMS\\Fluid\\Core\\Compiler\\AbstractCompiledTemplate';
-
-        $templateCode = <<<EOD
-%s {
-
-public function getVariableContainer() {
-	// @todo
-	return new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
-}
-public function getLayoutName(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface \$renderingContext) {
-\$currentVariableContainer = \$renderingContext->getTemplateVariableContainer();
-%s
-return %s;
-}
-public function hasLayout() {
-return %s;
-}
-
-%s
-
-}
-EOD;
-        $templateCode = sprintf($templateCode,
-                $classDefinition,
-                $convertedLayoutNameNode['initialization'],
-                $convertedLayoutNameNode['execution'],
-                ($parsingState->hasLayout() ? 'TRUE' : 'FALSE'),
-                $generatedRenderFunctions);
-        $this->templateCache->set($identifier, $templateCode);
-    }
-
-    /**
-     * Replaces special characters by underscores
-     *
-     * @see http://www.php.net/manual/en/language.variables.basics.php
-     * @param string $identifier
-     * @return string the sanitized identifier
-     */
-    protected function sanitizeIdentifier($identifier)
-    {
-        return preg_replace('([^a-zA-Z0-9_\\x7f-\\xff])', '_', $identifier);
-    }
-
-    /**
-     * @param array $converted
-     * @param string $expectedFunctionName
-     * @param string $comment
-     * @return string
-     */
-    protected function generateCodeForSection(array $converted, $expectedFunctionName, $comment)
-    {
-        $templateCode = <<<EOD
-/**
- * %s
- */
-public function %s(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface \$renderingContext) {
-\$self = \$this;
-\$currentVariableContainer = \$renderingContext->getTemplateVariableContainer();
-
-%s
-
-return %s;
-}
-
-EOD;
-        return sprintf($templateCode, $comment, $expectedFunctionName, $converted['initialization'], $converted['execution']);
-    }
-
-    /**
-     * Returns an array with two elements:
-     * - initialization: contains PHP code which is inserted *before* the actual rendering call. Must be valid, i.e. end with semi-colon.
-     * - execution: contains *a single PHP instruction* which needs to return the rendered output of the given element. Should NOT end with semi-colon.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node
-     * @return array two-element array, see above
-     * @throws \TYPO3\CMS\Fluid\Exception
-     */
-    protected function convert(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node)
-    {
-        if ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode) {
-            return $this->convertTextNode($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode) {
-            return $this->convertNumericNode($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode) {
-            return $this->convertViewHelperNode($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode) {
-            return $this->convertObjectAccessorNode($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode) {
-            return $this->convertArrayNode($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode) {
-            return $this->convertListOfSubNodes($node);
-        } elseif ($node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode) {
-            return $this->convertBooleanNode($node);
-        } else {
-            throw new \TYPO3\CMS\Fluid\Exception('Syntax tree node type "' . get_class($node) . '" is not supported.');
-        }
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertTextNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode $node)
-    {
-        return array(
-            'initialization' => '',
-            'execution' => '\'' . $this->escapeTextForUseInSingleQuotes($node->getText()) . '\''
-        );
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertNumericNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode $node)
-    {
-        return array(
-            'initialization' => '',
-            'execution' => $node->getValue()
-        );
-    }
-
-    /**
-     * Convert a single ViewHelperNode into its cached representation. If the ViewHelper implements the "Compilable" facet,
-     * the ViewHelper itself is asked for its cached PHP code representation. If not, a ViewHelper is built and then invoked.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertViewHelperNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
-    {
-        $initializationPhpCode = '// Rendering ViewHelper ' . $node->getViewHelperClassName() . LF;
-
-        // Build up $arguments array
-        $argumentsVariableName = $this->variableName('arguments');
-        $initializationPhpCode .= sprintf('%s = array();', $argumentsVariableName) . LF;
-
-        $alreadyBuiltArguments = array();
-        foreach ($node->getArguments() as $argumentName => $argumentValue) {
-            $converted = $this->convert($argumentValue);
-            $initializationPhpCode .= $converted['initialization'];
-            $initializationPhpCode .= sprintf('%s[\'%s\'] = %s;', $argumentsVariableName, $argumentName, $converted['execution']) . LF;
-            $alreadyBuiltArguments[$argumentName] = true;
-        }
-
-        foreach ($node->getUninitializedViewHelper()->prepareArguments() as $argumentName => $argumentDefinition) {
-            if (!isset($alreadyBuiltArguments[$argumentName])) {
-                $initializationPhpCode .= sprintf('%s[\'%s\'] = %s;', $argumentsVariableName, $argumentName, var_export($argumentDefinition->getDefaultValue(), true)) . LF;
-            }
-        }
-
-        // Build up closure which renders the child nodes
-        $renderChildrenClosureVariableName = $this->variableName('renderChildrenClosure');
-        $initializationPhpCode .= sprintf('%s = %s;', $renderChildrenClosureVariableName, $this->wrapChildNodesInClosure($node)) . LF;
-
-        if ($node->getUninitializedViewHelper() instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface) {
-            // ViewHelper is compilable
-            $viewHelperInitializationPhpCode = '';
-            $convertedViewHelperExecutionCode = $node->getUninitializedViewHelper()->compile($argumentsVariableName, $renderChildrenClosureVariableName, $viewHelperInitializationPhpCode, $node, $this);
-            $initializationPhpCode .= $viewHelperInitializationPhpCode;
-            if ($convertedViewHelperExecutionCode !== self::SHOULD_GENERATE_VIEWHELPER_INVOCATION) {
-                return array(
-                    'initialization' => $initializationPhpCode,
-                    'execution' => $convertedViewHelperExecutionCode
-                );
-            }
-        }
-
-        // ViewHelper is not compilable, so we need to instanciate it directly and render it.
-        $viewHelperVariableName = $this->variableName('viewHelper');
-
-        $initializationPhpCode .= sprintf('%s = $self->getViewHelper(\'%s\', $renderingContext, \'%s\');', $viewHelperVariableName, $viewHelperVariableName, $node->getViewHelperClassName()) . LF;
-        $initializationPhpCode .= sprintf('%s->setArguments(%s);', $viewHelperVariableName, $argumentsVariableName) . LF;
-        $initializationPhpCode .= sprintf('%s->setRenderingContext($renderingContext);', $viewHelperVariableName) . LF;
-
-        $initializationPhpCode .= sprintf('%s->setRenderChildrenClosure(%s);', $viewHelperVariableName, $renderChildrenClosureVariableName) . LF;
-
-        $initializationPhpCode .= '// End of ViewHelper ' . $node->getViewHelperClassName() . LF;
-
-        return array(
-            'initialization' => $initializationPhpCode,
-            'execution' => sprintf('%s->initializeArgumentsAndRender()', $viewHelperVariableName)
-        );
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertObjectAccessorNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node)
-    {
-        $objectPathSegments = explode('.', $node->getObjectPath());
-        $firstPathElement = array_shift($objectPathSegments);
-        if ($objectPathSegments === array()) {
-            return array(
-                'initialization' => '',
-                'execution' => sprintf('$currentVariableContainer->getOrNull(\'%s\')', $firstPathElement)
-            );
-        } else {
-            $executionCode = '\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::getPropertyPath($currentVariableContainer->getOrNull(\'%s\'), \'%s\', $renderingContext)';
-            return array(
-                'initialization' => '',
-                'execution' => sprintf($executionCode, $firstPathElement, implode('.', $objectPathSegments))
-            );
-        }
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertArrayNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode $node)
-    {
-        $initializationPhpCode = '// Rendering Array' . LF;
-        $arrayVariableName = $this->variableName('array');
-
-        $initializationPhpCode .= sprintf('%s = array();', $arrayVariableName) . LF;
-
-        foreach ($node->getInternalArray() as $key => $value) {
-            if ($value instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode) {
-                $converted = $this->convert($value);
-                $initializationPhpCode .= $converted['initialization'];
-                $initializationPhpCode .= sprintf('%s[\'%s\'] = %s;', $arrayVariableName, $key, $converted['execution']) . LF;
-            } elseif (is_numeric($value)) {
-                // this case might happen for simple values
-                $initializationPhpCode .= sprintf('%s[\'%s\'] = %s;', $arrayVariableName, $key, $value) . LF;
-            } else {
-                // this case might happen for simple values
-                $initializationPhpCode .= sprintf('%s[\'%s\'] = \'%s\';', $arrayVariableName, $key, $this->escapeTextForUseInSingleQuotes($value)) . LF;
-            }
-        }
-        return array(
-            'initialization' => $initializationPhpCode,
-            'execution' => $arrayVariableName
-        );
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node
-     * @return array
-     * @see convert()
-     */
-    public function convertListOfSubNodes(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node)
-    {
-        switch (count($node->getChildNodes())) {
-            case 0:
-                return array(
-                    'initialization' => '',
-                    'execution' => 'NULL'
-                );
-            case 1:
-                $converted = $this->convert(current($node->getChildNodes()));
-
-                return $converted;
-            default:
-                $outputVariableName = $this->variableName('output');
-                $initializationPhpCode = sprintf('%s = \'\';', $outputVariableName) . LF;
-
-                foreach ($node->getChildNodes() as $childNode) {
-                    $converted = $this->convert($childNode);
-
-                    $initializationPhpCode .= $converted['initialization'] . LF;
-                    $initializationPhpCode .= sprintf('%s .= %s;', $outputVariableName, $converted['execution']) . LF;
-                }
-
-                return array(
-                    'initialization' => $initializationPhpCode,
-                    'execution' => $outputVariableName
-                );
-        }
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode $node
-     * @return array
-     * @see convert()
-     */
-    protected function convertBooleanNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode $node)
-    {
-        $initializationPhpCode = '// Rendering Boolean node' . LF;
-        if ($node->getComparator() !== null) {
-            $convertedLeftSide = $this->convert($node->getLeftSide());
-            $convertedRightSide = $this->convert($node->getRightSide());
-
-            return array(
-                'initialization' => $initializationPhpCode . $convertedLeftSide['initialization'] . $convertedRightSide['initialization'],
-                'execution' => sprintf(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::class . '::evaluateComparator(\'%s\', %s, %s)', $node->getComparator(), $convertedLeftSide['execution'], $convertedRightSide['execution'])
-            );
-        } else {
-            // simple case, no comparator.
-            $converted = $this->convert($node->getSyntaxTreeNode());
-            return array(
-                'initialization' => $initializationPhpCode . $converted['initialization'],
-                'execution' => sprintf(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::class . '::convertToBoolean(%s)', $converted['execution'])
-            );
-        }
-    }
-
-    /**
-     * @param string $text
-     * @return string
-     */
-    protected function escapeTextForUseInSingleQuotes($text)
-    {
-        return str_replace(array('\\', '\''), array('\\\\', '\\\''), $text);
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node
-     * @return string
-     */
-    public function wrapChildNodesInClosure(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node)
-    {
-        $convertedSubNodes = $this->convertListOfSubNodes($node);
-        if ($convertedSubNodes['execution'] === 'NULL') {
-            return 'function() {return NULL;}';
-        }
-
-        $closure = '';
-        $closure .= 'function() use ($renderingContext, $self) {' . LF;
-        $closure .= '$currentVariableContainer = $renderingContext->getTemplateVariableContainer();' . LF;
-        $closure .= $convertedSubNodes['initialization'];
-        $closure .= sprintf('return %s;', $convertedSubNodes['execution']) . LF;
-        $closure .= '}';
-        return $closure;
-    }
-
-    /**
-     * Returns a unique variable name by appending a global index to the given prefix
-     *
-     * @param string $prefix
-     * @return string
-     */
-    public function variableName($prefix)
-    {
-        return '$' . $prefix . $this->variableCounter++;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Exception.php b/typo3/sysext/fluid/Classes/Core/Exception.php
deleted file mode 100644
index 027c54f348b3..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Exception.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A generic Fluid Core exception.
- *
- * @api
- */
-class Exception extends \TYPO3\CMS\Fluid\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/Configuration.php b/typo3/sysext/fluid/Classes/Core/Parser/Configuration.php
deleted file mode 100644
index 52a4ba11c56a..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/Configuration.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * The parser configuration. Contains all configuration needed to configure
- * the building of a SyntaxTree.
- */
-class Configuration
-{
-    /**
-     * Generic interceptors registered with the configuration.
-     *
-     * @var array<\TYPO3\CMS\Extbase\Persistence\ObjectStorage>
-     */
-    protected $interceptors = array();
-
-    /**
-     * Adds an interceptor to apply to values coming from object accessors.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface $interceptor
-     * @return void
-     */
-    public function addInterceptor(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface $interceptor)
-    {
-        foreach ($interceptor->getInterceptionPoints() as $interceptionPoint) {
-            if (!isset($this->interceptors[$interceptionPoint])) {
-                $this->interceptors[$interceptionPoint] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
-            }
-            if (!$this->interceptors[$interceptionPoint]->contains($interceptor)) {
-                $this->interceptors[$interceptionPoint]->attach($interceptor);
-            }
-        }
-    }
-
-    /**
-     * Returns all interceptors for a given Interception Point.
-     *
-     * @param int $interceptionPoint one of the \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_* constants,
-     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface>
-     */
-    public function getInterceptors($interceptionPoint)
-    {
-        if (isset($this->interceptors[$interceptionPoint]) && $this->interceptors[$interceptionPoint] instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage) {
-            return $this->interceptors[$interceptionPoint];
-        }
-        return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/Exception.php b/typo3/sysext/fluid/Classes/Core/Parser/Exception.php
deleted file mode 100644
index 704c47142718..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/Exception.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A Parsing Exception
- *
- * @api
- */
-class Exception extends \TYPO3\CMS\Fluid\Core\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php b/typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
deleted file mode 100644
index 84c3231ba8e6..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\Interceptor;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * An interceptor adding the escape viewhelper to the suitable places.
- */
-class Escape implements \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface
-{
-    /**
-     * Is the interceptor enabled right now?
-     *
-     * @var bool
-     */
-    protected $interceptorEnabled = true;
-
-    /**
-     * A stack of ViewHelperNodes which currently disable the interceptor.
-     * Needed to enable the interceptor again.
-     *
-     * @var array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface>
-     */
-    protected $viewHelperNodesWhichDisableTheInterceptor = array();
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
-     */
-    protected $objectManager;
-
-    /**
-     * Adds a ViewHelper node using the Format\HtmlspecialcharsViewHelper to the given node.
-     * If "escapingInterceptorEnabled" in the ViewHelper is FALSE, will disable itself inside the ViewHelpers body.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $node
-     * @param int $interceptorPosition One of the INTERCEPT_* constants for the current interception point
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState the current parsing state. Not needed in this interceptor.
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface
-     */
-    public function process(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $node, $interceptorPosition, \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState)
-    {
-        if ($interceptorPosition === \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER) {
-            if (!$node->getUninitializedViewHelper()->isEscapingInterceptorEnabled()) {
-                $this->interceptorEnabled = false;
-                $this->viewHelperNodesWhichDisableTheInterceptor[] = $node;
-            }
-        } elseif ($interceptorPosition === \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER) {
-            if (end($this->viewHelperNodesWhichDisableTheInterceptor) === $node) {
-                array_pop($this->viewHelperNodesWhichDisableTheInterceptor);
-                if (count($this->viewHelperNodesWhichDisableTheInterceptor) === 0) {
-                    $this->interceptorEnabled = true;
-                }
-            }
-        } elseif ($this->interceptorEnabled && $node instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode) {
-            $escapeViewHelper = $this->objectManager->get(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class);
-            $node = $this->objectManager->get(
-                \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class,
-                $escapeViewHelper,
-                array('value' => $node)
-            );
-        }
-        return $node;
-    }
-
-    /**
-     * This interceptor wants to hook into object accessor creation, and opening / closing ViewHelpers.
-     *
-     * @return array Array of INTERCEPT_* constants
-     */
-    public function getInterceptionPoints()
-    {
-        return array(
-            \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER,
-            \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER,
-            \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR
-        );
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php b/typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php
deleted file mode 100644
index 910e2681dae0..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * An interceptor interface. Interceptors are used in the parsing stage to change
- * the syntax tree of a template, e.g. by adding viewhelper nodes.
- */
-interface InterceptorInterface
-{
-    const INTERCEPT_OPENING_VIEWHELPER = 1;
-    const INTERCEPT_CLOSING_VIEWHELPER = 2;
-    const INTERCEPT_TEXT = 3;
-    const INTERCEPT_OBJECTACCESSOR = 4;
-
-    /**
-     * The interceptor can process the given node at will and must return a node
-     * that will be used in place of the given node.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $node
-     * @param int $interceptorPosition One of the INTERCEPT_* constants for the current interception point
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState the parsing state
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface
-     */
-    public function process(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $node, $interceptorPosition, \TYPO3\CMS\Fluid\Core\Parser\ParsingState $parsingState);
-
-    /**
-     * The interceptor should define at which interception positions it wants to be called.
-     *
-     * @return array Array of INTERCEPT_* constants
-     */
-    public function getInterceptionPoints();
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/ParsedTemplateInterface.php b/typo3/sysext/fluid/Classes/Core/Parser/ParsedTemplateInterface.php
deleted file mode 100644
index 13b16d3e0b1e..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/ParsedTemplateInterface.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * This interface is returned by \TYPO3\CMS\Fluid\Core\Parser\TemplateParser->parse()
- * method and is a parsed template
- */
-interface ParsedTemplateInterface
-{
-    /**
-     * Render the parsed template with rendering context
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext The rendering context to use
-     * @return string Rendered string
-     */
-    public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext);
-
-    /**
-     * Returns a variable container used in the PostParse Facet.
-     *
-     * @todo remove
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
-     */
-    public function getVariableContainer();
-
-    /**
-     * Returns the name of the layout that is defined within the current template via <f:layout name="..." />
-     * If no layout is defined, this returns NULL
-     * This requires the current rendering context in order to be able to evaluate the layout name
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public function getLayoutName(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext);
-
-    /**
-     * Returns TRUE if the current template has a template defined via <f:layout name="..." />
-     *
-     * @see getLayoutName()
-     * @return bool
-     */
-    public function hasLayout();
-
-    /**
-     * If the template contains constructs which prevent the compiler from compiling the template
-     * correctly, isCompilable() will return FALSE.
-     *
-     * @return bool TRUE if the template can be compiled
-     */
-    public function isCompilable();
-
-    /**
-     * @return bool TRUE if the template is already compiled, FALSE otherwise
-     */
-    public function isCompiled();
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/ParsingState.php b/typo3/sysext/fluid/Classes/Core/Parser/ParsingState.php
deleted file mode 100644
index 38628bc9b481..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/ParsingState.php
+++ /dev/null
@@ -1,213 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Stores all information relevant for one parsing pass - that is, the root node,
- * and the current stack of open nodes (nodeStack) and a variable container used
- * for PostParseFacets.
- */
-class ParsingState implements \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface
-{
-    /**
-     * Root node reference
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode
-     */
-    protected $rootNode;
-
-    /**
-     * Array of node references currently open.
-     *
-     * @var array
-     */
-    protected $nodeStack = array();
-
-    /**
-     * Variable container where ViewHelpers implementing the PostParseFacet can
-     * store things in.
-     *
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
-     * @inject
-     */
-    protected $variableContainer;
-
-    /**
-     * The layout name of the current template or NULL if the template does not contain a layout definition
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     */
-    protected $layoutNameNode;
-
-    /**
-     * @var bool
-     */
-    protected $compilable = true;
-
-    /**
-     * Set root node of this parsing state
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $rootNode
-     * @return void
-     */
-    public function setRootNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $rootNode)
-    {
-        $this->rootNode = $rootNode;
-    }
-
-    /**
-     * Get root node of this parsing state.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode The root node
-     */
-    public function getRootNode()
-    {
-        return $this->rootNode;
-    }
-
-    /**
-     * Render the parsed template with rendering context
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext The rendering context to use
-     * @return string Rendered string
-     */
-    public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return $this->rootNode->evaluate($renderingContext);
-    }
-
-    /**
-     * Push a node to the node stack. The node stack holds all currently open
-     * templating tags.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node Node to push to node stack
-     * @return void
-     */
-    public function pushNodeToStack(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node)
-    {
-        array_push($this->nodeStack, $node);
-    }
-
-    /**
-     * Get the top stack element, without removing it.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode the top stack element.
-     */
-    public function getNodeFromStack()
-    {
-        return $this->nodeStack[count($this->nodeStack) - 1];
-    }
-
-    /**
-     * Pop the top stack element (=remove it) and return it back.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode the top stack element, which was removed.
-     */
-    public function popNodeFromStack()
-    {
-        return array_pop($this->nodeStack);
-    }
-
-    /**
-     * Count the size of the node stack
-     *
-     * @return int Number of elements on the node stack (i.e. number of currently open Fluid tags)
-     */
-    public function countNodeStack()
-    {
-        return count($this->nodeStack);
-    }
-
-    /**
-     * Returns a variable container which will be then passed to the postParseFacet.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer The variable container or NULL if none has been set yet
-     * @todo Rename to getPostParseVariableContainer
-     */
-    public function getVariableContainer()
-    {
-        return $this->variableContainer;
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $layoutNameNode name of the layout that is defined in this template via <f:layout name="..." />
-     * @return void
-     */
-    public function setLayoutNameNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $layoutNameNode)
-    {
-        $this->layoutNameNode = $layoutNameNode;
-    }
-
-    /**
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     */
-    public function getLayoutNameNode()
-    {
-        return $this->layoutNameNode;
-    }
-
-    /**
-     * Returns TRUE if the current template has a template defined via <f:layout name="..." />
-     *
-     * @see getLayoutName()
-     * @return bool
-     */
-    public function hasLayout()
-    {
-        return $this->layoutNameNode !== null;
-    }
-
-    /**
-     * Returns the name of the layout that is defined within the current template via <f:layout name="..." />
-     * If no layout is defined, this returns NULL
-     * This requires the current rendering context in order to be able to evaluate the layout name
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string
-     * @throws \TYPO3\CMS\Fluid\View\Exception
-     */
-    public function getLayoutName(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        if (!$this->hasLayout()) {
-            return null;
-        }
-        $layoutName = $this->layoutNameNode->evaluate($renderingContext);
-        if (!empty($layoutName)) {
-            return $layoutName;
-        }
-        throw new \TYPO3\CMS\Fluid\View\Exception('The layoutName could not be evaluated to a string', 1296805368);
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCompilable()
-    {
-        return $this->compilable;
-    }
-
-    /**
-     * @param bool $compilable
-     */
-    public function setCompilable($compilable)
-    {
-        $this->compilable = $compilable;
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCompiled()
-    {
-        return false;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessor.php b/typo3/sysext/fluid/Classes/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessor.php
new file mode 100644
index 000000000000..b879da14327b
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessor.php
@@ -0,0 +1,85 @@
+<?php
+namespace TYPO3\CMS\Fluid\Core\Parser\PreProcessor;
+
+/*
+ * 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!
+ */
+
+use TYPO3Fluid\Fluid\Core\Parser\TemplateProcessorInterface;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+
+/**
+ * Class XmlnsNamespaceTemplatePreProcessor
+ */
+class XmlnsNamespaceTemplatePreProcessor implements TemplateProcessorInterface
+{
+    /**
+     * @var RenderingContextInterface
+     */
+    protected $renderingContext;
+
+    /**
+     * @param RenderingContextInterface $renderingContext
+     * @return void
+     */
+    public function setRenderingContext(RenderingContextInterface $renderingContext)
+    {
+        $this->renderingContext = $renderingContext;
+    }
+
+    /**
+     * Pre-process the template source before it is returned to the TemplateParser or passed to
+     * the next TemplateProcessorInterface instance.
+     *
+     * Detects all tags that carry an `xmlns:` definition using a Fluid-compatible prefix and a
+     * conventional namespace URL (http://typo3.org/ns/). Extracts the detected namespaces and 
+     * removes the detected tag.
+     *
+     * @param string $templateSource
+     * @return string
+     */
+    public function preProcessSource($templateSource)
+    {
+        $matches = array();
+        $namespacePattern = 'xmlns:([a-z0-9]+)="(http\\:\\/\\/typo3\\.org\\/ns\\/[^"]+)"';
+        $matched = preg_match_all('/<([a-z0-9]+)\\s+(?:[^>]+\\s+)*' . $namespacePattern . '[^>]*>/', $templateSource, $matches, PREG_SET_ORDER);
+        if ($matched) {
+            $namespaces = array();
+            preg_match_all('/' . $namespacePattern . '/', $matches[0][0], $namespaces, PREG_SET_ORDER);
+            foreach ($namespaces as $set) {
+                $namespaceUrl = $set[2];
+                $namespaceUri = substr($namespaceUrl, 20);
+                $namespacePhp = str_replace('/', '\\', $namespaceUri);
+                $this->renderingContext->getViewHelperResolver()->addNamespace($set[1], $namespacePhp);
+            }
+            if (strpos($matches[0][0], 'data-namespace-typo3-fluid="true"')) {
+                $templateSource = str_replace($matches[0][0], '', $templateSource);
+                $closingTagName = $matches[0][1];
+                $closingTag = '</' . $closingTagName . '>';
+                if (strpos($templateSource, $closingTag)) {
+                    $templateSource = substr($templateSource, 0, strrpos($templateSource, $closingTag)) .
+                        substr($templateSource, strrpos($templateSource, $closingTag) + strlen($closingTag));
+                }
+            } else {
+                if (!empty($namespaces)) {
+                    $namespaceAttributesToRemove = [];
+                    foreach ($namespaces as $namespace) {
+                        $namespaceAttributesToRemove[] = preg_quote($namespace[1], '/') . '="' . preg_quote($namespace[2], '/') . '"';
+                    }
+                    $matchWithRemovedNamespaceAttributes = preg_replace('/(?:\\s*+xmlns:(?:' . implode('|', $namespaceAttributesToRemove) . ')\\s*+)++/', ' ', $matches[0][0]);
+                    $templateSource = str_replace($matches[0][0], $matchWithRemovedNamespaceAttributes, $templateSource);
+                }
+            }
+        }
+        return $templateSource;
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/AbstractNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/AbstractNode.php
deleted file mode 100644
index c9239894807b..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/AbstractNode.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Abstract node in the syntax tree which has been built.
- */
-abstract class AbstractNode implements \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface
-{
-    /**
-     * List of Child Nodes.
-     *
-     * @var array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface>
-     */
-    protected $childNodes = array();
-
-    /**
-     * Evaluate all child nodes and return the evaluated results.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed Normally, an object is returned - in case it is concatenated with a string, a string is returned.
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function evaluateChildNodes(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $output = null;
-        foreach ($this->childNodes as $subNode) {
-            if ($output === null) {
-                $output = $subNode->evaluate($renderingContext);
-            } else {
-                if (is_object($output)) {
-                    if (!method_exists($output, '__toString')) {
-                        throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Cannot cast object of type "' . get_class($output) . '" to string.', 1248356140);
-                    }
-                    $output = $output->__toString();
-                } else {
-                    $output = (string)$output;
-                }
-                $subNodeOutput = $subNode->evaluate($renderingContext);
-
-                if (is_object($subNodeOutput)) {
-                    if (!method_exists($subNodeOutput, '__toString')) {
-                        throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Cannot cast object of type "' . get_class($subNodeOutput) . '" to string.', 1273753083);
-                    }
-                    $output .= $subNodeOutput->__toString();
-                } else {
-                    $output .= (string)$subNodeOutput;
-                }
-            }
-        }
-        return $output;
-    }
-
-    /**
-     * Returns all child nodes for a given node.
-     * This is especially needed to implement the boolean expression language.
-     *
-     * @return array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface> A list of nodes
-     */
-    public function getChildNodes()
-    {
-        return $this->childNodes;
-    }
-
-    /**
-     * Appends a subnode to this node. Is used inside the parser to append children
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode The subnode to add
-     * @return void
-     */
-    public function addChildNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode)
-    {
-        $this->childNodes[] = $childNode;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ArrayNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ArrayNode.php
deleted file mode 100644
index 04d2d77b7b4d..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ArrayNode.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Array Syntax Tree Node. Handles JSON-like arrays.
- */
-class ArrayNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * An associative array. Each key is a string. Each value is either a literal, or an AbstractNode.
-     *
-     * @var array
-     */
-    protected $internalArray = array();
-
-    /**
-     * Constructor.
-     *
-     * @param array $internalArray Array to store
-     */
-    public function __construct($internalArray)
-    {
-        $this->internalArray = $internalArray;
-    }
-
-    /**
-     * Evaluate the array and return an evaluated array
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return array An associative array with literal values
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $arrayToBuild = array();
-        foreach ($this->internalArray as $key => $value) {
-            if ($value instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode) {
-                $arrayToBuild[$key] = $value->evaluate($renderingContext);
-            } else {
-                // @todo - this case should not happen!
-                $arrayToBuild[$key] = $value;
-            }
-        }
-        return $arrayToBuild;
-    }
-
-    /**
-     * INTERNAL; DO NOT CALL DIRECTLY!
-     *
-     * @return array
-     */
-    public function getInternalArray()
-    {
-        return $this->internalArray;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php
deleted file mode 100644
index 99153092a345..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php
+++ /dev/null
@@ -1,352 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A node which is used inside boolean arguments
- */
-class BooleanNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * List of comparators which are supported in the boolean expression language.
-     *
-     * Make sure that if one string is contained in one another, the longer
-     * string is listed BEFORE the shorter one.
-     * Example: put ">=" before ">"
-     *
-     * @var array
-     */
-    protected static $comparators = array('==', '!=', '%', '>=', '>', '<=', '<');
-
-    /**
-     * A regular expression which checks the text nodes of a boolean expression.
-     * Used to define how the regular expression language should look like.
-     *
-     * @var string
-     */
-    protected static $booleanExpressionTextNodeCheckerRegularExpression = '/
-		^                 # Start with first input symbol
-		(?:               # start repeat
-			COMPARATORS   # We allow all comparators
-			|\s*          # Arbitary spaces
-			|-?           # Numbers, possibly with the "minus" symbol in front.
-				[0-9]+    # some digits
-				(?:       # and optionally a dot, followed by some more digits
-					\\.
-					[0-9]+
-				)?
-			|\'[^\'\\\\]* # single quoted string literals with possibly escaped single quotes
-				(?:
-					\\\\.      # escaped character
-					[^\'\\\\]* # unrolled loop following Jeffrey E.F. Friedl
-				)*\'
-			|"[^"\\\\]*   # double quoted string literals with possibly escaped double quotes
-				(?:
-					\\\\.     # escaped character
-					[^"\\\\]* # unrolled loop following Jeffrey E.F. Friedl
-				)*"
-		)*
-		$/x';
-
-    /**
-     * Left side of the comparison
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     */
-    protected $leftSide;
-
-    /**
-     * Right side of the comparison
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     */
-    protected $rightSide;
-
-    /**
-     * The comparator. One element of self::$comparators. If NULL,
-     * no comparator was found, and self::$syntaxTreeNode should
-     * instead be evaluated.
-     *
-     * @var string
-     */
-    protected $comparator;
-
-    /**
-     * If no comparator was found, the syntax tree node should be
-     * converted to boolean.
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     */
-    protected $syntaxTreeNode;
-
-    /**
-     * Constructor. Parses the syntax tree node and fills $this->leftSide, $this->rightSide,
-     * $this->comparator and $this->syntaxTreeNode.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function __construct(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode)
-    {
-        $childNodes = $syntaxTreeNode->getChildNodes();
-        if (count($childNodes) > 3) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('A boolean expression has more than tree parts.', 1244201848);
-        } elseif (count($childNodes) === 0) {
-            // In this case, we do not have child nodes; i.e. the current SyntaxTreeNode
-            // is a text node with a literal comparison like "1 == 1"
-            $childNodes = array($syntaxTreeNode);
-        }
-
-        $this->leftSide = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $this->rightSide = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $this->comparator = null;
-        foreach ($childNodes as $childNode) {
-            if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode && !preg_match(str_replace('COMPARATORS', implode('|', self::$comparators), self::$booleanExpressionTextNodeCheckerRegularExpression), $childNode->getText())) {
-                // $childNode is text node, and no comparator found.
-                $this->comparator = null;
-                // skip loop and fall back to classical to boolean conversion.
-                break;
-            }
-
-            if ($this->comparator !== null) {
-                // comparator already set, we are evaluating the right side of the comparator
-                $this->rightSide->addChildNode($childNode);
-            } elseif ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode
-                && ($this->comparator = $this->getComparatorFromString($childNode->getText()))) {
-                // comparator in current string segment
-                $explodedString = explode($this->comparator, $childNode->getText());
-                if (isset($explodedString[0]) && trim($explodedString[0]) !== '') {
-                    $value = trim($explodedString[0]);
-                    if (is_numeric($value)) {
-                        $this->leftSide->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($value));
-                    } else {
-                        $this->leftSide->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode(preg_replace('/(^[\'"]|[\'"]$)/', '', $value)));
-                    }
-                }
-                if (isset($explodedString[1]) && trim($explodedString[1]) !== '') {
-                    $value = trim($explodedString[1]);
-                    if (is_numeric($value)) {
-                        $this->rightSide->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($value));
-                    } else {
-                        $this->rightSide->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode(preg_replace('/(^[\'"]|[\'"]$)/', '', $value)));
-                    }
-                }
-            } else {
-                // comparator not found yet, on the left side of the comparator
-                $this->leftSide->addChildNode($childNode);
-            }
-        }
-
-        if ($this->comparator === null) {
-            // No Comparator found, we need to evaluate the given syntax tree node manually
-            $this->syntaxTreeNode = $syntaxTreeNode;
-        }
-    }
-
-    /**
-     * @return string
-     * @internal
-     */
-    public function getComparator()
-    {
-        return $this->comparator;
-    }
-
-    /**
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     * @internal
-     */
-    public function getSyntaxTreeNode()
-    {
-        return $this->syntaxTreeNode;
-    }
-
-    /**
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     * @internal
-     */
-    public function getLeftSide()
-    {
-        return $this->leftSide;
-    }
-
-    /**
-     * @return \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     * @internal
-     */
-    public function getRightSide()
-    {
-        return $this->rightSide;
-    }
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return bool the boolean value
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        if ($this->comparator !== null) {
-            return self::evaluateComparator($this->comparator, $this->leftSide->evaluate($renderingContext), $this->rightSide->evaluate($renderingContext));
-        } else {
-            $value = $this->syntaxTreeNode->evaluate($renderingContext);
-            return self::convertToBoolean($value);
-        }
-    }
-
-    /**
-     * Do the actual comparison. Compares $leftSide and $rightSide with $comparator and emits a boolean value.
-     *
-     * Some special rules apply:
-     * - The == and != operators are comparing the Object Identity using === and !==, when one of the two
-     *   operands are objects.
-     * - For arithmetic comparisons (%, >, >=, <, <=), some special rules apply:
-     *   - arrays are only comparable with arrays, else the comparison yields FALSE
-     *   - objects are only comparable with objects, else the comparison yields FALSE
-     *   - the comparison is FALSE when two types are not comparable according to the table
-     *     "Comparison with various types" on http://php.net/manual/en/language.operators.comparison.php
-     *
-     * This function must be static public, as it is also directly called from cached templates.
-     *
-     * @param string $comparator
-     * @param mixed $evaluatedLeftSide
-     * @param mixed $evaluatedRightSide
-     * @return bool TRUE if comparison of left and right side using the comparator emit TRUE, false otherwise
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public static function evaluateComparator($comparator, $evaluatedLeftSide, $evaluatedRightSide)
-    {
-        switch ($comparator) {
-            case '==':
-                if (is_object($evaluatedLeftSide) || is_object($evaluatedRightSide)) {
-                    return ($evaluatedLeftSide === $evaluatedRightSide);
-                } else {
-                    return ($evaluatedLeftSide == $evaluatedRightSide);
-                }
-            case '!=':
-                if (is_object($evaluatedLeftSide) || is_object($evaluatedRightSide)) {
-                    return ($evaluatedLeftSide !== $evaluatedRightSide);
-                } else {
-                    return ($evaluatedLeftSide != $evaluatedRightSide);
-                }
-            case '%':
-                if (!self::isComparable($evaluatedLeftSide, $evaluatedRightSide)) {
-                    return false;
-                }
-                return (bool)((int)$evaluatedLeftSide % (int)$evaluatedRightSide);
-            case '>':
-                if (!self::isComparable($evaluatedLeftSide, $evaluatedRightSide)) {
-                    return false;
-                }
-                return $evaluatedLeftSide > $evaluatedRightSide;
-            case '>=':
-                if (!self::isComparable($evaluatedLeftSide, $evaluatedRightSide)) {
-                    return false;
-                }
-                return $evaluatedLeftSide >= $evaluatedRightSide;
-            case '<':
-                if (!self::isComparable($evaluatedLeftSide, $evaluatedRightSide)) {
-                    return false;
-                }
-                return $evaluatedLeftSide < $evaluatedRightSide;
-            case '<=':
-                if (!self::isComparable($evaluatedLeftSide, $evaluatedRightSide)) {
-                    return false;
-                }
-                return $evaluatedLeftSide <= $evaluatedRightSide;
-            default:
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Comparator "' . $comparator . '" is not implemented.', 1244234398);
-        }
-    }
-
-    /**
-     * Checks whether two operands are comparable (based on their types). This implements
-     * the "Comparison with various types" table from http://php.net/manual/en/language.operators.comparison.php,
-     * only leaving out "array" with "anything" and "object" with anything; as we specify
-     * that arrays and objects are incomparable with anything else than their type.
-     *
-     * @param mixed $evaluatedLeftSide
-     * @param mixed $evaluatedRightSide
-     * @return bool TRUE if the operands can be compared using arithmetic operators, FALSE otherwise.
-     */
-    protected static function isComparable($evaluatedLeftSide, $evaluatedRightSide)
-    {
-        if ((is_null($evaluatedLeftSide) || is_string($evaluatedLeftSide))
-            && is_string($evaluatedRightSide)) {
-            return true;
-        }
-        if (is_bool($evaluatedLeftSide) || is_null($evaluatedLeftSide)) {
-            return true;
-        }
-        if (is_object($evaluatedLeftSide) && is_object($evaluatedRightSide)) {
-            return true;
-        }
-        if ((is_string($evaluatedLeftSide) || is_resource($evaluatedLeftSide) || is_numeric($evaluatedLeftSide))
-            && (is_string($evaluatedRightSide) || is_resource($evaluatedRightSide) || is_numeric($evaluatedRightSide))) {
-            return true;
-        }
-        if (is_array($evaluatedLeftSide) && is_array($evaluatedRightSide)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Determine if there is a comparator inside $string, and if yes, returns it.
-     *
-     * @param string $string string to check for a comparator inside
-     * @return string The comparator or NULL if none found.
-     */
-    protected function getComparatorFromString($string)
-    {
-        foreach (self::$comparators as $comparator) {
-            if (strpos($string, $comparator) !== false) {
-                return $comparator;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Convert argument strings to their equivalents. Needed to handle strings with a boolean meaning.
-     *
-     * Must be public and static as it is used from inside cached templates.
-     *
-     * @param mixed $value Value to be converted to boolean
-     * @return bool
-     */
-    public static function convertToBoolean($value)
-    {
-        if (is_bool($value)) {
-            return $value;
-        }
-
-        if (is_integer($value) || is_float($value)) {
-            return !empty($value);
-        }
-
-        if (is_numeric($value)) {
-            return ($value != 0);
-        }
-
-        if (is_string($value)) {
-            return (!empty($value) && strtolower($value) !== 'false');
-        }
-        if (is_array($value) || (is_object($value) && $value instanceof \Countable)) {
-            return (bool)count($value);
-        }
-        if (is_object($value)) {
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/Expression/LegacyNamespaceExpressionNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/Expression/LegacyNamespaceExpressionNode.php
new file mode 100644
index 000000000000..67894a8f2c6e
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/Expression/LegacyNamespaceExpressionNode.php
@@ -0,0 +1,42 @@
+<?php
+namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\Expression;
+
+/*
+ * 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!
+ */
+
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\AbstractExpressionNode;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\ExpressionNodeInterface;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+
+/**
+ * Class LegacyNamespaceExpressionNode
+ */
+class LegacyNamespaceExpressionNode extends AbstractExpressionNode implements ExpressionNodeInterface
+{
+    /**
+     * Pattern which detects ternary conditions written in shorthand
+     * syntax, e.g. {checkvar ? thenvar : elsevar}.
+     */
+    public static $detectionExpression = '/{namespace\\s*([a-z0-9]+)\\s*=\\s*([a-z0-9_\\\\]+)\\s*}/i';
+
+    /**
+     * @param RenderingContextInterface $renderingContext
+     * @param string $expression
+     * @param array $matches
+     * @return mixed
+     */
+    public static function evaluateExpression(RenderingContextInterface $renderingContext, $expression, array $matches)
+    {
+        $renderingContext->getViewHelperResolver()->addNamespace($matches[1], $matches[2]);
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php
deleted file mode 100644
index 056b6d91a228..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Node in the syntax tree.
- */
-interface NodeInterface
-{
-    /**
-     * Evaluate all child nodes and return the evaluated results.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed Normally, an object is returned - in case it is concatenated with a string, a string is returned.
-     */
-    public function evaluateChildNodes(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext);
-
-    /**
-     * Returns all child nodes for a given node.
-     *
-     * @return array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface> A list of nodes
-     */
-    public function getChildNodes();
-
-    /**
-     * Appends a subnode to this node. Is used inside the parser to append children
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode The subnode to add
-     * @return void
-     */
-    public function addChildNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode);
-
-    /**
-     * Evaluates the node - can return not only strings, but arbitary objects.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed Evaluated node
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext);
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NumericNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NumericNode.php
deleted file mode 100644
index 07ca5f645453..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NumericNode.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script belongs to the TYPO3 Flow package "Fluid".                 *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- * of the License, or (at your option) any later version.                 *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Numeric Syntax Tree Node - is a container for numerics.
- *
- */
-class NumericNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * Contents of the numeric node
-     * @var number
-     */
-    protected $value;
-
-    /**
-     * Constructor.
-     *
-     * @param string|number $value value to store in this numericNode
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function __construct($value)
-    {
-        if (!is_numeric($value)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Numeric node requires an argument of type number, "' . gettype($value) . '" given.', 1360414192);
-        }
-        $this->value = $value + 0;
-    }
-
-    /**
-     * Return the value associated to the syntax tree.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return number the value stored in this node/subtree.
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return $this->value;
-    }
-
-    /**
-     * Getter for value
-     *
-     * @return number The value of this node
-     */
-    public function getValue()
-    {
-        return $this->value;
-    }
-
-    /**
-     * NumericNode does not allow adding child nodes, so this will always throw an exception.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode The subnode to add
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     * @return void
-     */
-    public function addChildNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode)
-    {
-        throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Numeric nodes may not contain child nodes, tried to add "' . get_class($childNode) . '".', 1360414193);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php
deleted file mode 100644
index d04203acd495..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A node which handles object access. This means it handles structures like {object.accessor.bla}
- */
-class ObjectAccessorNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * Object path which will be called. Is a list like "post.name.email"
-     *
-     * @var string
-     */
-    protected $objectPath;
-
-    /**
-     * Constructor. Takes an object path as input.
-     *
-     * The first part of the object path has to be a variable in the
-     * TemplateVariableContainer.
-     *
-     * @param string $objectPath An Object Path, like object1.object2.object3
-     */
-    public function __construct($objectPath)
-    {
-        $this->objectPath = $objectPath;
-    }
-
-    /**
-     * Internally used for building up cached templates; do not use directly!
-     *
-     * @return string
-     * @internal
-     */
-    public function getObjectPath()
-    {
-        return $this->objectPath;
-    }
-
-    /**
-     * Evaluate this node and return the correct object.
-     *
-     * Handles each part (denoted by .) in $this->objectPath in the following order:
-     * - call appropriate getter
-     * - call public property, if exists
-     * - fail
-     *
-     * The first part of the object path has to be a variable in the
-     * TemplateVariableContainer.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed The evaluated object, can be any object type.
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return self::getPropertyPath($renderingContext->getTemplateVariableContainer(), $this->objectPath, $renderingContext);
-    }
-
-    /**
-     * Gets a property path from a given object or array.
-     *
-     * If propertyPath is "bla.blubb", then we first call getProperty($object, 'bla'),
-     * and on the resulting object we call getProperty(..., 'blubb').
-     *
-     * For arrays the keys are checked likewise.
-     *
-     * @param mixed $subject An object or array
-     * @param string $propertyPath
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed Value of the property
-     */
-    public static function getPropertyPath($subject, $propertyPath, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $propertyPathSegments = explode('.', $propertyPath);
-        foreach ($propertyPathSegments as $pathSegment) {
-            if ($subject === null || is_scalar($subject)) {
-                return null;
-            }
-            $propertyExists = false;
-            $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyInternal($subject, $pathSegment, false, $propertyExists);
-            if ($propertyExists !== true && (is_array($subject) || $subject instanceof \ArrayAccess) && isset($subject[$pathSegment])) {
-                $subject = $subject[$pathSegment];
-            } else {
-                $subject = $propertyValue;
-            }
-        }
-        return $subject;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/RootNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/RootNode.php
deleted file mode 100644
index d06bea680d3b..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/RootNode.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Root node of every syntax tree.
- */
-class RootNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * Evaluate the root node, by evaluating the subtree.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed Evaluated subtree
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return $this->evaluateChildNodes($renderingContext);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/TextNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/TextNode.php
deleted file mode 100644
index d12fbe7bf0bb..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/TextNode.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Text Syntax Tree Node - is a container for strings.
- */
-class TextNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * Contents of the text node
-     *
-     * @var string
-     */
-    protected $text;
-
-    /**
-     * Constructor.
-     *
-     * @param string $text text to store in this textNode
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function __construct($text)
-    {
-        if (!is_string($text)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Text node requires an argument of type string, "' . gettype($text) . '" given.');
-        }
-        $this->text = $text;
-    }
-
-    /**
-     * Return the text associated to the syntax tree. Text from child nodes is
-     * appended to the text in the node's own text.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string the text stored in this node/subtree.
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return $this->text . $this->evaluateChildNodes($renderingContext);
-    }
-
-    /**
-     * Getter for text
-     *
-     * @return string The text of this node
-     */
-    public function getText()
-    {
-        return $this->text;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ViewHelperNode.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ViewHelperNode.php
deleted file mode 100644
index 62046345b323..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ViewHelperNode.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Node which will call a ViewHelper associated with this node.
- */
-class ViewHelperNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-{
-    /**
-     * Class name of view helper
-     *
-     * @var string
-     */
-    protected $viewHelperClassName;
-
-    /**
-     * Arguments of view helper - References to RootNodes.
-     *
-     * @var array
-     */
-    protected $arguments = array();
-
-    /**
-     * The ViewHelper associated with this node
-     *
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
-     */
-    protected $uninitializedViewHelper = null;
-
-    /**
-     * A mapping RenderingContext -> ViewHelper to only re-initialize ViewHelpers
-     * when a context change occurs.
-     *
-     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
-     */
-    protected $viewHelpersByContext = null;
-
-    /**
-     * Constructor.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper The view helper
-     * @param array $arguments Arguments of view helper - each value is a RootNode.
-     */
-    public function __construct(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper, array $arguments)
-    {
-        $this->uninitializedViewHelper = $viewHelper;
-        $this->viewHelpersByContext = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
-        $this->arguments = $arguments;
-        $this->viewHelperClassName = get_class($this->uninitializedViewHelper);
-    }
-
-    /**
-     * Returns the attached (but still uninitialized) ViewHelper for this ViewHelperNode.
-     * We need this method because sometimes Interceptors need to ask some information from the ViewHelper.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper the attached ViewHelper, if it is initialized
-     */
-    public function getUninitializedViewHelper()
-    {
-        return $this->uninitializedViewHelper;
-    }
-
-    /**
-     * Get class name of view helper
-     *
-     * @return string Class Name of associated view helper
-     */
-    public function getViewHelperClassName()
-    {
-        return $this->viewHelperClassName;
-    }
-
-    /**
-     * INTERNAL - only needed for compiling templates
-     *
-     * @return array
-     * @internal
-     */
-    public function getArguments()
-    {
-        return $this->arguments;
-    }
-
-    /**
-     * Call the view helper associated with this object.
-     *
-     * First, it evaluates the arguments of the view helper.
-     *
-     * If the view helper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface,
-     * it calls setChildNodes(array childNodes) on the view helper.
-     *
-     * Afterwards, checks that the view helper did not leave a variable lying around.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string evaluated node after the view helper has been called.
-     */
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        if ($this->viewHelpersByContext->contains($renderingContext)) {
-            $viewHelper = $this->viewHelpersByContext[$renderingContext];
-            $viewHelper->resetState();
-        } else {
-            $viewHelper = clone $this->uninitializedViewHelper;
-            $this->viewHelpersByContext->attach($renderingContext, $viewHelper);
-        }
-
-        $evaluatedArguments = array();
-        if (count($viewHelper->prepareArguments())) {
-            foreach ($viewHelper->prepareArguments() as $argumentName => $argumentDefinition) {
-                if (isset($this->arguments[$argumentName])) {
-                    $argumentValue = $this->arguments[$argumentName];
-                    $evaluatedArguments[$argumentName] = $argumentValue->evaluate($renderingContext);
-                } else {
-                    $evaluatedArguments[$argumentName] = $argumentDefinition->getDefaultValue();
-                }
-            }
-        }
-
-        $viewHelper->setArguments($evaluatedArguments);
-        $viewHelper->setViewHelperNode($this);
-        $viewHelper->setRenderingContext($renderingContext);
-
-        if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface) {
-            $viewHelper->setChildNodes($this->childNodes);
-        }
-
-        $output = $viewHelper->initializeArgumentsAndRender();
-
-        return $output;
-    }
-
-    /**
-     * Clean up for serializing.
-     *
-     * @return array
-     */
-    public function __sleep()
-    {
-        return array('viewHelperClassName', 'arguments', 'childNodes');
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php b/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
deleted file mode 100644
index 0308846b6b2f..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
+++ /dev/null
@@ -1,973 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Template parser building up an object syntax tree
- */
-class TemplateParser
-{
-    public static $SCAN_PATTERN_NAMESPACEDECLARATION = '/(?<!\\\\){namespace\\s*(?P<identifier>[a-zA-Z]+[a-zA-Z0-9]*)\\s*=\\s*(?P<phpNamespace>(?:[A-Za-z0-9\.]+|Tx)(?:LEGACY_NAMESPACE_SEPARATOR\\w+|FLUID_NAMESPACE_SEPARATOR\\w+)+)\\s*}/m';
-    public static $SCAN_PATTERN_XMLNSDECLARATION = '/\sxmlns:(?P<identifier>.*?)="(?P<xmlNamespace>.*?)"/m';
-
-    /**
-     * The following two constants are used for tracking whether we are currently
-     * parsing ViewHelper arguments or not. This is used to parse arrays only as
-     * ViewHelper argument.
-     */
-    const CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS = 1;
-    const CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS = 2;
-
-    /**
-     * This regular expression splits the input string at all dynamic tags, AND
-     * on all <![CDATA[...]]> sections.
-     */
-    public static $SPLIT_PATTERN_TEMPLATE_DYNAMICTAGS = '/
-		(
-			(?: <\\/?                                      # Start dynamic tags
-					(?:(?:NAMESPACE):[a-zA-Z0-9\\.]+)     # A tag consists of the namespace prefix and word characters
-					(?:                                   # Begin tag arguments
-						\\s*[a-zA-Z0-9:-]+                  # Argument Keys
-						=                                 # =
-						(?>                               # either... If we have found an argument, we will not back-track (That does the Atomic Bracket)
-							"(?:\\\\"|[^"])*"              # a double-quoted string
-							|\'(?:\\\\\'|[^\'])*\'        # or a single quoted string
-						)\\s*                              #
-					)*                                    # Tag arguments can be replaced many times.
-				\\s*
-				\\/?>                                      # Closing tag
-			)
-			|(?:                                          # Start match CDATA section
-				<!\\[CDATA\\[.*?\\]\\]>
-			)
-		)/xs';
-
-    /**
-     * This regular expression scans if the input string is a ViewHelper tag
-     */
-    public static $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG = '/
-		^<                                                # A Tag begins with <
-		(?P<NamespaceIdentifier>NAMESPACE):               # Then comes the Namespace prefix followed by a :
-		(?P<MethodIdentifier>                             # Now comes the Name of the ViewHelper
-			[a-zA-Z0-9\\.]+
-		)
-		(?P<Attributes>                                   # Begin Tag Attributes
-			(?:                                           # A tag might have multiple attributes
-				\\s*
-				[a-zA-Z0-9:-]+                             # The attribute name
-				=                                         # =
-				(?>                                       # either... # If we have found an argument, we will not back-track (That does the Atomic Bracket)
-					"(?:\\\\"|[^"])*"                      # a double-quoted string
-					|\'(?:\\\\\'|[^\'])*\'                # or a single quoted string
-				)                                         #
-				\\s*
-			)*                                            # A tag might have multiple attributes
-		)                                                 # End Tag Attributes
-		\\s*
-		(?P<Selfclosing>\\/?)                              # A tag might be selfclosing
-		>$/x';
-
-    /**
-     * This regular expression scans if the input string is a closing ViewHelper
-     * tag.
-     */
-    public static $SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG = '/^<\\/(?P<NamespaceIdentifier>NAMESPACE):(?P<MethodIdentifier>[a-zA-Z0-9\\.]+)\\s*>$/';
-
-    /**
-     * This regular expression scans for HTML tags that have the attribute
-     * data-namespace-typo3-fluid="true".
-     * If this attribute is added to the HTML tag, the HTML tag will be removed
-     * from the rendered output.
-     */
-    public static $SCAN_PATTERN_NAMESPACE_FLUID_HTML_TAG = '/<html\\s++[^>]*data-namespace-typo3-fluid="true"[^>]*>/m';
-
-    /**
-     * This regular expression is used to remove xmlns attributes that are used
-     * to register ViewHelper namespaces.
-     *
-     * Replaces trailing empty spaces to avoid additional new lines that might be in the the tag.
-     * It is therefore necessary to replace the pattern with space instead of empty string.
-     *
-     * Searches for multiple xmlns declarations after one another to only replace them with one space,
-     * instead of one per xmlns definition.
-     */
-    public static $SCAN_PATTERN_REMOVE_VIEWHELPERS_XMLNSDECLARATIONS = '/(?:\\s*+xmlns:(?:%1$s)="[^"]*"\\s*+)++/m';
-
-    /**
-     * This regular expression splits the tag arguments into its parts
-     */
-    public static $SPLIT_PATTERN_TAGARGUMENTS = '/
-		(?:                                              #
-			\\s*                                          #
-			(?P<Argument>                                # The attribute name
-				[a-zA-Z0-9:-]+                            #
-			)                                            #
-			=                                            # =
-			(?>                                          # If we have found an argument, we will not back-track (That does the Atomic Bracket)
-				(?P<ValueQuoted>                         # either...
-					(?:"(?:\\\\"|[^"])*")                 # a double-quoted string
-					|(?:\'(?:\\\\\'|[^\'])*\')           # or a single quoted string
-				)
-			)\\s*
-		)
-		/xs';
-
-    /**
-     * This pattern detects CDATA sections and outputs the text between opening
-     * and closing CDATA.
-     */
-    public static $SCAN_PATTERN_CDATA = '/^<!\\[CDATA\\[(.*?)\\]\\]>$/s';
-
-    /**
-     * Pattern which splits the shorthand syntax into different tokens. The
-     * "shorthand syntax" is everything like {...}
-     */
-    public static $SPLIT_PATTERN_SHORTHANDSYNTAX = '/
-		(
-			{                                # Start of shorthand syntax
-				(?:                          # Shorthand syntax is either composed of...
-					[a-zA-Z0-9\\->_:,.()]     # Various characters
-					|"(?:\\\\"|[^"])*"        # Double-quoted strings
-					|\'(?:\\\\\'|[^\'])*\'   # Single-quoted strings
-					|(?R)                    # Other shorthand syntaxes inside, albeit not in a quoted string
-					|\\s+                     # Spaces
-				)+
-			}                                # End of shorthand syntax
-		)/x';
-
-    /**
-     * Pattern which detects the object accessor syntax:
-     * {object.some.value}, additionally it detects ViewHelpers like
-     * {f:for(param1:bla)} and chaining like
-     * {object.some.value->f:bla.blubb()->f:bla.blubb2()}
-     *
-     * THIS IS ALMOST THE SAME AS IN $SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS
-     */
-    public static $SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS = '/
-		^{                                                      # Start of shorthand syntax
-			                                                # A shorthand syntax is either...
-			(?P<Object>[a-zA-Z0-9\\-_.]*)                                     # ... an object accessor
-			\\s*(?P<Delimiter>(?:->)?)\\s*
-
-			(?P<ViewHelper>                                 # ... a ViewHelper
-				[a-zA-Z0-9]+                                # Namespace prefix of ViewHelper (as in $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG)
-				:
-				[a-zA-Z0-9\\.]+                             # Method Identifier (as in $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG)
-				\\(                                          # Opening parameter brackets of ViewHelper
-					(?P<ViewHelperArguments>                # Start submatch for ViewHelper arguments. This is taken from $SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS
-						(?:
-							\\s*[a-zA-Z0-9\\-_]+                  # The keys of the array
-							\\s*:\\s*                             # Key|Value delimiter :
-							(?:                                 # Possible value options:
-								"(?:\\\\"|[^"])*"                # Double qouoted string
-								|\'(?:\\\\\'|[^\'])*\'          # Single quoted string
-								|[a-zA-Z0-9\\-_.]+               # variable identifiers
-								|{(?P>ViewHelperArguments)}     # Another sub-array
-							)                                   # END possible value options
-							\\s*,?                               # There might be a , to separate different parts of the array
-						)*                                  # The above cycle is repeated for all array elements
-					)                                       # End ViewHelper Arguments submatch
-				\\)                                          # Closing parameter brackets of ViewHelper
-			)?
-			(?P<AdditionalViewHelpers>                      # There can be more than one ViewHelper chained, by adding more -> and the ViewHelper (recursively)
-				(?:
-					\\s*->\\s*
-					(?P>ViewHelper)
-				)*
-			)
-		}$/x';
-
-    /**
-     * THIS IS ALMOST THE SAME AS $SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS
-     */
-    public static $SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER = '/
-
-		(?P<NamespaceIdentifier>[a-zA-Z0-9]+)       # Namespace prefix of ViewHelper (as in $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG)
-		:
-		(?P<MethodIdentifier>[a-zA-Z0-9\\.]+)
-		\\(                                          # Opening parameter brackets of ViewHelper
-			(?P<ViewHelperArguments>                # Start submatch for ViewHelper arguments. This is taken from $SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS
-				(?:
-					\\s*[a-zA-Z0-9\\-_]+                  # The keys of the array
-					\\s*:\\s*                             # Key|Value delimiter :
-					(?:                                 # Possible value options:
-						"(?:\\\\"|[^"])*"                # Double qouoted string
-						|\'(?:\\\\\'|[^\'])*\'          # Single quoted string
-						|[a-zA-Z0-9\\-_.]+               # variable identifiers
-						|{(?P>ViewHelperArguments)}     # Another sub-array
-					)                                   # END possible value options
-					\\s*,?                               # There might be a , to separate different parts of the array
-				)*                                  # The above cycle is repeated for all array elements
-			)                                       # End ViewHelper Arguments submatch
-		\\)                                          # Closing parameter brackets of ViewHelper
-		/x';
-
-    /**
-     * Pattern which detects the array/object syntax like in JavaScript, so it
-     * detects strings like:
-     * {object: value, object2: {nested: array}, object3: "Some string"}
-     *
-     * THIS IS ALMOST THE SAME AS IN SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS
-     */
-    public static $SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS = '/^
-		(?P<Recursion>                                  # Start the recursive part of the regular expression - describing the array syntax
-			{                                           # Each array needs to start with {
-				(?P<Array>                              # Start submatch
-					(?:
-						\\s*[a-zA-Z0-9\\-_]+              # The keys of the array
-						\\s*:\\s*                         # Key|Value delimiter :
-						(?:                             # Possible value options:
-							"(?:\\\\"|[^"])*"            # Double qouoted string
-							|\'(?:\\\\\'|[^\'])*\'      # Single quoted string
-							|[a-zA-Z0-9\\-_.]+           # variable identifiers
-							|(?P>Recursion)             # Another sub-array
-						)                               # END possible value options
-						\\s*,?                           # There might be a , to separate different parts of the array
-					)*                                  # The above cycle is repeated for all array elements
-				)                                       # End array submatch
-			}                                           # Each array ends with }
-		)$/x';
-
-    /**
-     * This pattern splits an array into its parts. It is quite similar to the
-     * pattern above.
-     */
-    public static $SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS = '/
-		(?P<ArrayPart>                                             # Start submatch
-			(?P<Key>[a-zA-Z0-9\\-_]+)                               # The keys of the array
-			\\s*:\\s*                                                   # Key|Value delimiter :
-			(?:                                                       # Possible value options:
-				(?P<QuotedString>                                     # Quoted string
-					(?:"(?:\\\\"|[^"])*")
-					|(?:\'(?:\\\\\'|[^\'])*\')
-				)
-				|(?P<VariableIdentifier>[a-zA-Z][a-zA-Z0-9\\-_.]*)    # variable identifiers have to start with a letter
-				|(?P<Number>[0-9.]+)                                  # Number
-				|{\\s*(?P<Subarray>(?:(?P>ArrayPart)\\s*,?\\s*)+)\\s*}              # Another sub-array
-			)                                                         # END possible value options
-		)                                                          # End array part submatch
-	/x';
-
-    /**
-     * This pattern detects the default xml namespace
-     *
-     */
-    public static $SCAN_PATTERN_DEFAULT_XML_NAMESPACE = '/^http\:\/\/typo3\.org\/ns\/(?P<PhpNamespace>.+)$/s';
-
-    /**
-     * Namespace identifiers and their component name prefix (Associative array).
-     * @var array
-     */
-    protected $namespaces = array(
-        'f' => 'TYPO3\\CMS\\Fluid\\ViewHelpers'
-    );
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
-     */
-    protected $objectManager;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\Configuration
-     */
-    protected $configuration;
-
-    /**
-     * @var array
-     */
-    protected $settings;
-
-    /**
-     * @var array
-     */
-    protected $viewHelperNameToImplementationClassNameRuntimeCache = array();
-
-    /**
-     * Constructor. Preprocesses the $SCAN_PATTERN_NAMESPACEDECLARATION by
-     * inserting the correct namespace separator.
-     */
-    public function __construct()
-    {
-        self::$SCAN_PATTERN_NAMESPACEDECLARATION = str_replace(
-            array(
-                'LEGACY_NAMESPACE_SEPARATOR',
-                'FLUID_NAMESPACE_SEPARATOR'
-            ),
-            array(
-                preg_quote(\TYPO3\CMS\Fluid\Fluid::LEGACY_NAMESPACE_SEPARATOR),
-                preg_quote(\TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR)
-            ),
-            self::$SCAN_PATTERN_NAMESPACEDECLARATION
-        );
-    }
-
-    /**
-     * Injects Fluid settings
-     *
-     * @param array $settings
-     */
-    public function injectSettings(array $settings)
-    {
-        $this->settings = $settings;
-    }
-
-    /**
-     * Set the configuration for the parser.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\Configuration $configuration
-     * @return void
-     */
-    public function setConfiguration(\TYPO3\CMS\Fluid\Core\Parser\Configuration $configuration = null)
-    {
-        $this->configuration = $configuration;
-    }
-
-    /**
-     * Parses a given template string and returns a parsed template object.
-     *
-     * The resulting ParsedTemplate can then be rendered by calling evaluate() on it.
-     *
-     * Normally, you should use a subclass of AbstractTemplateView instead of calling the
-     * TemplateParser directly.
-     *
-     * @param string $templateString The template to parse as a string
-     * @return \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface Parsed template
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function parse($templateString)
-    {
-        if (!is_string($templateString)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Parse requires a template string as argument, ' . gettype($templateString) . ' given.', 1224237899);
-        }
-        $this->reset();
-
-        $templateString = $this->extractNamespaceDefinitions($templateString);
-        $splitTemplate = $this->splitTemplateAtDynamicTags($templateString);
-
-        $parsingState = $this->buildObjectTree($splitTemplate, self::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
-
-        $variableContainer = $parsingState->getVariableContainer();
-        if ($variableContainer !== null && $variableContainer->exists('layoutName')) {
-            $parsingState->setLayoutNameNode($variableContainer->get('layoutName'));
-        }
-
-        return $parsingState;
-    }
-
-    /**
-     * Gets the namespace definitions found.
-     *
-     * @return array Namespace identifiers and their component name prefix
-     */
-    public function getNamespaces()
-    {
-        return $this->namespaces;
-    }
-
-    /**
-     * Resets the parser to its default values.
-     *
-     * @return void
-     */
-    protected function reset()
-    {
-        $this->namespaces = array(
-            'f' => 'TYPO3\\CMS\\Fluid\\ViewHelpers'
-        );
-    }
-
-    /**
-     * Extracts namespace definitions out of the given template string and sets
-     * $this->namespaces.
-     *
-     * @param string $templateString Template string to extract the namespaces from
-     * @return string The updated template string without namespace declarations inside
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception if a namespace can't be resolved or has been declared already
-     */
-    protected function extractNamespaceDefinitions($templateString)
-    {
-        $matches = array();
-        $foundIdentifiers = array();
-        preg_match_all(self::$SCAN_PATTERN_XMLNSDECLARATION, $templateString, $matches, PREG_SET_ORDER);
-        foreach ($matches as $match) {
-            // skip reserved "f" namespace identifier
-            if ($match['identifier'] === 'f') {
-                $foundIdentifiers[] = 'f';
-                continue;
-            }
-            if (array_key_exists($match['identifier'], $this->namespaces)) {
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception(sprintf('Namespace identifier "%s" is already registered. Do not re-declare namespaces!', $match['identifier']), 1331135889);
-            }
-            if (isset($this->settings['namespaces'][$match['xmlNamespace']])) {
-                $phpNamespace = $this->settings['namespaces'][$match['xmlNamespace']];
-            } else {
-                $matchedPhpNamespace = array();
-                if (preg_match(self::$SCAN_PATTERN_DEFAULT_XML_NAMESPACE, $match['xmlNamespace'], $matchedPhpNamespace) === 0) {
-                    continue;
-                }
-                $phpNamespace = str_replace('/', '\\', $matchedPhpNamespace['PhpNamespace']);
-            }
-            $foundIdentifiers[] = $match['identifier'];
-            $this->namespaces[$match['identifier']] = $phpNamespace;
-        }
-
-        $templateString = $this->removeXmlnsViewHelperNamespaceDeclarations($templateString, $foundIdentifiers);
-
-        $matches = array();
-        preg_match_all(self::$SCAN_PATTERN_NAMESPACEDECLARATION, $templateString, $matches, PREG_SET_ORDER);
-        foreach ($matches as $match) {
-            if (array_key_exists($match['identifier'], $this->namespaces)) {
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception(sprintf('Namespace identifier "%s" is already registered. Do not re-declare namespaces!', $match['identifier']), 1224241246);
-            }
-            $this->namespaces[$match['identifier']] = $match['phpNamespace'];
-        }
-        if ($matches !== array()) {
-            $templateString = preg_replace(self::$SCAN_PATTERN_NAMESPACEDECLARATION, '', $templateString);
-        }
-
-        return $templateString;
-    }
-
-    /**
-     * Removes html-tag (opening & closing) that is only used for xmlns definition
-     * and xmlns attributes that register ViewHelpers on any tags
-     *
-     * @param string $templateString
-     * @param array $foundIdentifiers
-     * @return string
-     */
-    protected function removeXmlnsViewHelperNamespaceDeclarations($templateString, array $foundIdentifiers)
-    {
-        $foundHtmlTags = 0;
-        $templateString = preg_replace(self::$SCAN_PATTERN_NAMESPACE_FLUID_HTML_TAG, '', $templateString, 1, $foundHtmlTags);
-        if ($foundHtmlTags > 0) {
-            $templateString = str_replace('</html>', '', $templateString);
-        }
-
-        if (!empty($foundIdentifiers)) {
-            $foundIdentifiers = array_map(function ($foundIdentifier) {
-                return preg_quote($foundIdentifier, '/');
-            }, $foundIdentifiers);
-            $foundIdentifiers = implode('|', $foundIdentifiers);
-
-            // replaces the pattern with space because the pattern includes trailing spaces and consecutive xmlns ViewHelper defintions
-            $templateString = preg_replace(
-                sprintf(self::$SCAN_PATTERN_REMOVE_VIEWHELPERS_XMLNSDECLARATIONS, $foundIdentifiers),
-                ' ',
-                $templateString
-            );
-        }
-
-        return $templateString;
-    }
-
-    /**
-     * Splits the template string on all dynamic tags found.
-     *
-     * @param string $templateString Template string to split.
-     * @return array Splitted template
-     */
-    protected function splitTemplateAtDynamicTags($templateString)
-    {
-        $regularExpression = $this->prepareTemplateRegularExpression(self::$SPLIT_PATTERN_TEMPLATE_DYNAMICTAGS);
-        return preg_split($regularExpression, $templateString, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-    }
-
-    /**
-     * Build object tree from the split template
-     *
-     * @param array $splitTemplate The split template, so that every tag with a namespace declaration is already a separate array element.
-     * @param int $context one of the CONTEXT_* constants, defining whether we are inside or outside of ViewHelper arguments currently.
-     * @return \TYPO3\CMS\Fluid\Core\Parser\ParsingState
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function buildObjectTree($splitTemplate, $context)
-    {
-        $regularExpression_openingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG);
-        $regularExpression_closingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG);
-
-        $state = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $rootNode = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-        $state->setRootNode($rootNode);
-        $state->pushNodeToStack($rootNode);
-
-        foreach ($splitTemplate as $templateElement) {
-            $matchedVariables = array();
-            if (preg_match(self::$SCAN_PATTERN_CDATA, $templateElement, $matchedVariables) > 0) {
-                $this->textHandler($state, $matchedVariables[1]);
-            } elseif (preg_match($regularExpression_openingViewHelperTag, $templateElement, $matchedVariables) > 0) {
-                $this->openingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier'], $matchedVariables['Attributes'], ($matchedVariables['Selfclosing'] !== ''));
-            } elseif (preg_match($regularExpression_closingViewHelperTag, $templateElement, $matchedVariables) > 0) {
-                $this->closingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier']);
-            } else {
-                $this->textAndShorthandSyntaxHandler($state, $templateElement, $context);
-            }
-        }
-
-        if ($state->countNodeStack() !== 1) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Not all tags were closed!', 1238169398);
-        }
-        return $state;
-    }
-
-    /**
-     * Handles an opening or self-closing view helper tag.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state Current parsing state
-     * @param string $namespaceIdentifier Namespace identifier - being looked up in $this->namespaces
-     * @param string $methodIdentifier Method identifier
-     * @param string $arguments Arguments string, not yet parsed
-     * @param bool $selfclosing true, if the tag is a self-closing tag.
-     * @return void
-     */
-    protected function openingViewHelperTagHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $namespaceIdentifier, $methodIdentifier, $arguments, $selfclosing)
-    {
-        $argumentsObjectTree = $this->parseArguments($arguments);
-        $this->initializeViewHelperAndAddItToStack($state, $namespaceIdentifier, $methodIdentifier, $argumentsObjectTree);
-
-        if ($selfclosing) {
-            $node = $state->popNodeFromStack();
-            $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER, $state);
-        }
-    }
-
-    /**
-     * Initialize the given ViewHelper and adds it to the current node and to
-     * the stack.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state Current parsing state
-     * @param string $namespaceIdentifier Namespace identifier - being looked up in $this->namespaces
-     * @param string $methodIdentifier Method identifier
-     * @param array $argumentsObjectTree Arguments object tree
-     * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function initializeViewHelperAndAddItToStack(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $namespaceIdentifier, $methodIdentifier, $argumentsObjectTree)
-    {
-        if (!array_key_exists($namespaceIdentifier, $this->namespaces)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Namespace could not be resolved. This exception should never be thrown!', 1224254792);
-        }
-        $viewHelper = $this->objectManager->get($this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier));
-        $this->viewHelperNameToImplementationClassNameRuntimeCache[$namespaceIdentifier][$methodIdentifier] = get_class($viewHelper);
-
-        // The following three checks are only done *in an uncached template*, and not needed anymore in the cached version
-        $expectedViewHelperArguments = $viewHelper->prepareArguments();
-        $this->abortIfUnregisteredArgumentsExist($expectedViewHelperArguments, $argumentsObjectTree);
-        $this->abortIfRequiredArgumentsAreMissing($expectedViewHelperArguments, $argumentsObjectTree);
-        $this->rewriteBooleanNodesInArgumentsObjectTree($expectedViewHelperArguments, $argumentsObjectTree);
-
-        $currentViewHelperNode = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, $viewHelper, $argumentsObjectTree);
-
-        $state->getNodeFromStack()->addChildNode($currentViewHelperNode);
-
-        if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface && !($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface)) {
-            $state->setCompilable(false);
-        }
-
-        // PostParse Facet
-        if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\PostParseInterface) {
-            $viewHelper::postParseEvent($currentViewHelperNode, $argumentsObjectTree, $state->getVariableContainer());
-        }
-
-        $this->callInterceptor($currentViewHelperNode, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER, $state);
-
-        $state->pushNodeToStack($currentViewHelperNode);
-    }
-
-    /**
-     * Throw an exception if there are arguments which were not registered
-     * before.
-     *
-     * @param array $expectedArguments Array of \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition of all expected arguments
-     * @param array $actualArguments Actual arguments
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function abortIfUnregisteredArgumentsExist($expectedArguments, $actualArguments)
-    {
-        $expectedArgumentNames = array();
-        foreach ($expectedArguments as $expectedArgument) {
-            $expectedArgumentNames[] = $expectedArgument->getName();
-        }
-
-        foreach ($actualArguments as $argumentName => $_) {
-            if (!in_array($argumentName, $expectedArgumentNames)) {
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Argument "' . $argumentName . '" was not registered.', 1237823695);
-            }
-        }
-    }
-
-    /**
-     * Throw an exception if required arguments are missing
-     *
-     * @param array $expectedArguments Array of \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition of all expected arguments
-     * @param array $actualArguments Actual arguments
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function abortIfRequiredArgumentsAreMissing($expectedArguments, $actualArguments)
-    {
-        $actualArgumentNames = array_keys($actualArguments);
-        foreach ($expectedArguments as $expectedArgument) {
-            if ($expectedArgument->isRequired() && !in_array($expectedArgument->getName(), $actualArgumentNames)) {
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Required argument "' . $expectedArgument->getName() . '" was not supplied.', 1237823699);
-            }
-        }
-    }
-
-    /**
-     * Wraps the argument tree, if a node is boolean, into a Boolean syntax tree node
-     *
-     * @param array $argumentDefinitions the argument definitions, key is the argument name, value is the ArgumentDefinition object
-     * @param array $argumentsObjectTree the arguments syntax tree, key is the argument name, value is an AbstractNode
-     * @return void
-     */
-    protected function rewriteBooleanNodesInArgumentsObjectTree($argumentDefinitions, &$argumentsObjectTree)
-    {
-        foreach ($argumentDefinitions as $argumentName => $argumentDefinition) {
-            if ($argumentDefinition->getType() === 'boolean' && isset($argumentsObjectTree[$argumentName])) {
-                $argumentsObjectTree[$argumentName] = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($argumentsObjectTree[$argumentName]);
-            }
-        }
-    }
-
-    /**
-     * Resolve a viewhelper name.
-     *
-     * @param string $namespaceIdentifier Namespace identifier for the view helper.
-     * @param string $methodIdentifier Method identifier, might be hierarchical like "link.url"
-     * @return string The fully qualified class name of the viewhelper
-     */
-    protected function resolveViewHelperName($namespaceIdentifier, $methodIdentifier)
-    {
-        if (isset($this->viewHelperNameToImplementationClassNameRuntimeCache[$namespaceIdentifier][$methodIdentifier])) {
-            $name = $this->viewHelperNameToImplementationClassNameRuntimeCache[$namespaceIdentifier][$methodIdentifier];
-        } else {
-            $explodedViewHelperName = explode('.', $methodIdentifier);
-            $namespaceSeparator = strpos($this->namespaces[$namespaceIdentifier], \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR) !== false ? \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR : \TYPO3\CMS\Fluid\Fluid::LEGACY_NAMESPACE_SEPARATOR;
-            if (count($explodedViewHelperName) > 1) {
-                $className = implode($namespaceSeparator, array_map('ucfirst', $explodedViewHelperName));
-            } else {
-                $className = ucfirst($explodedViewHelperName[0]);
-            }
-            $className .= 'ViewHelper';
-            $name = $this->namespaces[$namespaceIdentifier] . $namespaceSeparator . $className;
-            $name = \TYPO3\CMS\Core\Core\ClassLoadingInformation::getClassNameForAlias($name);
-            // The name isn't cached in viewHelperNameToImplementationClassNameRuntimeCache here because the
-            // class could be overloaded by extbase object manager. Thus the cache is filled in
-            // initializeViewHelperAndAddItToStack after getting the real object from the object manager.
-        }
-        return $name;
-    }
-
-    /**
-     * Handles a closing view helper tag
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state The current parsing state
-     * @param string $namespaceIdentifier Namespace identifier for the closing tag.
-     * @param string $methodIdentifier Method identifier.
-     * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function closingViewHelperTagHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $namespaceIdentifier, $methodIdentifier)
-    {
-        if (!array_key_exists($namespaceIdentifier, $this->namespaces)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Namespace could not be resolved. This exception should never be thrown!', 1224256186);
-        }
-        $lastStackElement = $state->popNodeFromStack();
-        if (!($lastStackElement instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('You closed a templating tag which you never opened!', 1224485838);
-        }
-        if ($lastStackElement->getViewHelperClassName() != $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier)) {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('Templating tags not properly nested. Expected: ' . $lastStackElement->getViewHelperClassName() . '; Actual: ' . $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier), 1224485398);
-        }
-        $this->callInterceptor($lastStackElement, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER, $state);
-    }
-
-    /**
-     * Handles the appearance of an object accessor (like {posts.author.email}).
-     * Creates a new instance of \TYPO3\CMS\Fluid\ObjectAccessorNode.
-     *
-     * Handles ViewHelpers as well which are in the shorthand syntax.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state The current parsing state
-     * @param string $objectAccessorString String which identifies which objects to fetch
-     * @param string $delimiter
-     * @param string $viewHelperString
-     * @param string $additionalViewHelpersString
-     * @return void
-     */
-    protected function objectAccessorHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $objectAccessorString, $delimiter, $viewHelperString, $additionalViewHelpersString)
-    {
-        $viewHelperString .= $additionalViewHelpersString;
-        $numberOfViewHelpers = 0;
-
-        // The following post-processing handles a case when there is only a ViewHelper, and no Object Accessor.
-        // Resolves bug #5107.
-        if ($delimiter === '' && $viewHelperString !== '') {
-            $viewHelperString = $objectAccessorString . $viewHelperString;
-            $objectAccessorString = '';
-        }
-
-        // ViewHelpers
-        $matches = array();
-        if ($viewHelperString !== '' && preg_match_all(self::$SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER, $viewHelperString, $matches, PREG_SET_ORDER) > 0) {
-            // The last ViewHelper has to be added first for correct chaining.
-            foreach (array_reverse($matches) as $singleMatch) {
-                if ($singleMatch['ViewHelperArguments'] !== '') {
-                    $arguments = $this->postProcessArgumentsForObjectAccessor(
-                        $this->recursiveArrayHandler($singleMatch['ViewHelperArguments'])
-                    );
-                } else {
-                    $arguments = array();
-                }
-                $this->initializeViewHelperAndAddItToStack($state, $singleMatch['NamespaceIdentifier'], $singleMatch['MethodIdentifier'], $arguments);
-                $numberOfViewHelpers++;
-            }
-        }
-
-        // Object Accessor
-        if ($objectAccessorString !== '') {
-            $node = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, $objectAccessorString);
-            $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR, $state);
-
-            $state->getNodeFromStack()->addChildNode($node);
-        }
-
-        // Close ViewHelper Tags if needed.
-        for ($i=0; $i<$numberOfViewHelpers; $i++) {
-            $node = $state->popNodeFromStack();
-            $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER, $state);
-        }
-    }
-
-    /**
-     * Call all interceptors registered for a given interception point.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $node The syntax tree node which can be modified by the interceptors.
-     * @param int $interceptionPoint the interception point. One of the \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_* constants.
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state the parsing state
-     * @return void
-     */
-    protected function callInterceptor(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface &$node, $interceptionPoint, \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state)
-    {
-        if ($this->configuration !== null) {
-            // $this->configuration is UNSET inside the arguments of a ViewHelper.
-            // That's why the interceptors are only called if the object accessor is not inside a ViewHelper Argument
-            // This could be a problem if We have a ViewHelper as an argument to another ViewHelper, and an ObjectAccessor nested inside there.
-            // @todo Clean up this.
-            $interceptors = $this->configuration->getInterceptors($interceptionPoint);
-            if (count($interceptors) > 0) {
-                foreach ($interceptors as $interceptor) {
-                    $node = $interceptor->process($node, $interceptionPoint, $state);
-                }
-            }
-        }
-    }
-
-    /**
-     * Post process the arguments for the ViewHelpers in the object accessor
-     * syntax. We need to convert an array into an array of (only) nodes
-     *
-     * @param array $arguments The arguments to be processed
-     * @return array the processed array
-     * @todo This method should become superflous once the rest has been refactored, so that this code is not needed.
-     */
-    protected function postProcessArgumentsForObjectAccessor(array $arguments)
-    {
-        foreach ($arguments as $argumentName => $argumentValue) {
-            if (!($argumentValue instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode)) {
-                $arguments[$argumentName] = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, (string)$argumentValue);
-            }
-        }
-        return $arguments;
-    }
-
-    /**
-     * Parse arguments of a given tag, and build up the Arguments Object Tree
-     * for each argument.
-     * Returns an associative array, where the key is the name of the argument,
-     * and the value is a single Argument Object Tree.
-     *
-     * @param string $argumentsString All arguments as string
-     * @return array An associative array of objects, where the key is the argument name.
-     */
-    protected function parseArguments($argumentsString)
-    {
-        $argumentsObjectTree = array();
-        $matches = array();
-        if (preg_match_all(self::$SPLIT_PATTERN_TAGARGUMENTS, $argumentsString, $matches, PREG_SET_ORDER) > 0) {
-            $configurationBackup = $this->configuration;
-            $this->configuration = null;
-            foreach ($matches as $singleMatch) {
-                $argument = $singleMatch['Argument'];
-                $value = $this->unquoteString($singleMatch['ValueQuoted']);
-                $argumentsObjectTree[$argument] = $this->buildArgumentObjectTree($value);
-            }
-            $this->configuration = $configurationBackup;
-        }
-        return $argumentsObjectTree;
-    }
-
-    /**
-     * Build up an argument object tree for the string in $argumentString.
-     * This builds up the tree for a single argument value.
-     *
-     * This method also does some performance optimizations, so in case
-     * no { or < is found, then we just return a TextNode.
-     *
-     * @param string $argumentString
-     * @return SyntaxTree\AbstractNode the corresponding argument object tree.
-     */
-    protected function buildArgumentObjectTree($argumentString)
-    {
-        if (strpos($argumentString, '{') === false && strpos($argumentString, '<') === false) {
-            return $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, $argumentString);
-        }
-        $splitArgument = $this->splitTemplateAtDynamicTags($argumentString);
-        $rootNode = $this->buildObjectTree($splitArgument, self::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS)->getRootNode();
-        return $rootNode;
-    }
-
-    /**
-     * Removes escapings from a given argument string and trims the outermost
-     * quotes.
-     *
-     * This method is meant as a helper for regular expression results.
-     *
-     * @param string $quotedValue Value to unquote
-     * @return string Unquoted value
-     */
-    protected function unquoteString($quotedValue)
-    {
-        switch ($quotedValue[0]) {
-            case '"':
-                $value = str_replace('\\"', '"', preg_replace('/(^"|"$)/', '', $quotedValue));
-            break;
-            case "'":
-                $value = str_replace("\\'", "'", preg_replace('/(^\'|\'$)/', '', $quotedValue));
-            break;
-            default:
-                $value = $quotedValue;
-        }
-        return str_replace('\\\\', '\\', $value);
-    }
-
-    /**
-     * Takes a regular expression template and replaces "NAMESPACE" with the
-     * currently registered namespace identifiers. Returns a regular expression
-     * which is ready to use.
-     *
-     * @param string $regularExpression Regular expression template
-     * @return string Regular expression ready to be used
-     */
-    protected function prepareTemplateRegularExpression($regularExpression)
-    {
-        return str_replace('NAMESPACE', implode('|', array_keys($this->namespaces)), $regularExpression);
-    }
-
-    /**
-     * Handler for everything which is not a ViewHelperNode.
-     *
-     * This includes Text, array syntax, and object accessor syntax.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state Current parsing state
-     * @param string $text Text to process
-     * @param int $context one of the CONTEXT_* constants, defining whether we are inside or outside of ViewHelper arguments currently.
-     * @return void
-     */
-    protected function textAndShorthandSyntaxHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $text, $context)
-    {
-        $sections = preg_split($this->prepareTemplateRegularExpression(self::$SPLIT_PATTERN_SHORTHANDSYNTAX), $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-
-        foreach ($sections as $section) {
-            $matchedVariables = array();
-            if (preg_match(self::$SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS, $section, $matchedVariables) > 0) {
-                $this->objectAccessorHandler($state, $matchedVariables['Object'], $matchedVariables['Delimiter'], isset($matchedVariables['ViewHelper']) ? $matchedVariables['ViewHelper'] : '', isset($matchedVariables['AdditionalViewHelpers']) ? $matchedVariables['AdditionalViewHelpers'] : '');
-            } elseif ($context === self::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS && preg_match(self::$SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS, $section, $matchedVariables) > 0) {
-                // We only match arrays if we are INSIDE viewhelper arguments
-                $this->arrayHandler($state, $matchedVariables['Array']);
-            } else {
-                $this->textHandler($state, $section);
-            }
-        }
-    }
-
-    /**
-     * Handler for array syntax. This creates the array object recursively and
-     * adds it to the current node.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state The current parsing state
-     * @param string $arrayText The array as string.
-     * @return void
-     */
-    protected function arrayHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $arrayText)
-    {
-        $state->getNodeFromStack()->addChildNode(
-            $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, $this->recursiveArrayHandler($arrayText))
-        );
-    }
-
-    /**
-     * Recursive function which takes the string representation of an array and
-     * builds an object tree from it.
-     *
-     * Deals with the following value types:
-     * - Numbers (Integers and Floats)
-     * - Strings
-     * - Variables
-     * - sub-arrays
-     *
-     * @param string $arrayText Array text
-     * @return SyntaxTree\ArrayNode the array node built up
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    protected function recursiveArrayHandler($arrayText)
-    {
-        $matches = array();
-        if (preg_match_all(self::$SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS, $arrayText, $matches, PREG_SET_ORDER) > 0) {
-            $arrayToBuild = array();
-            foreach ($matches as $singleMatch) {
-                $arrayKey = $singleMatch['Key'];
-                if (!empty($singleMatch['VariableIdentifier'])) {
-                    $arrayToBuild[$arrayKey] = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, $singleMatch['VariableIdentifier']);
-                } elseif (array_key_exists('Number', $singleMatch) && (!empty($singleMatch['Number']) || $singleMatch['Number'] === '0')) {
-                    $arrayToBuild[$arrayKey] = floatval($singleMatch['Number']);
-                } elseif ((array_key_exists('QuotedString', $singleMatch) && !empty($singleMatch['QuotedString']))) {
-                    $argumentString = $this->unquoteString($singleMatch['QuotedString']);
-                    $arrayToBuild[$arrayKey] = $this->buildArgumentObjectTree($argumentString);
-                } elseif (array_key_exists('Subarray', $singleMatch) && !empty($singleMatch['Subarray'])) {
-                    $arrayToBuild[$arrayKey] = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, $this->recursiveArrayHandler($singleMatch['Subarray']));
-                } else {
-                    throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('This exception should never be thrown, as the array value has to be of some type (Value given: "' . var_export($singleMatch, true) . '"). Please post your template to the bugtracker at forge.typo3.org.', 1225136013);
-                }
-            }
-            return $arrayToBuild;
-        } else {
-            throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('This exception should never be thrown, there is most likely some error in the regular expressions. Please post your template to the bugtracker at forge.typo3.org.', 1225136014);
-        }
-    }
-
-    /**
-     * Text node handler
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsingState $state
-     * @param string $text
-     * @return void
-     */
-    protected function textHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $text)
-    {
-        $node = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, $text);
-        $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_TEXT, $state);
-
-        $state->getNodeFromStack()->addChildNode($node);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
index 3802a68db054..5de3718d2330 100644
--- a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
+++ b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
@@ -1,17 +1,41 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\Rendering;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Cache\CacheManager;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache;
+use TYPO3\CMS\Fluid\Core\Parser\PreProcessor\XmlnsNamespaceTemplatePreProcessor;
+use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\Expression\LegacyNamespaceExpressionNode;
+use TYPO3\CMS\Fluid\Core\Variables\CmsVariableProvider;
+use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver;
+use TYPO3\CMS\Fluid\View\TemplatePaths;
+use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\CastingExpressionNode;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\MathExpressionNode;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\TernaryExpressionNode;
+use TYPO3Fluid\Fluid\Core\Parser\TemplateParser;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
+use TYPO3Fluid\Fluid\View\ViewInterface;
+
+/**
+ * Class RenderingContext
+ */
+class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext
 {
     /**
      * Template Variable Container. Contains all variables available through object accessors in the template
@@ -39,50 +63,112 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
     /**
      * ViewHelper Variable Container
      *
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
+     * @var \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer
      * @inject
      */
     protected $viewHelperVariableContainer;
 
     /**
-     * Returns the object manager. Only the ViewHelperNode should do this.
+     * Use legacy behavior? Can be overridden using setLegacyMode().
      *
-     * @return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+     * @var bool
      */
-    public function getObjectManager()
+    protected $legacyMode = false;
+
+    /**
+     * List of class names implementing ExpressionNodeInterface
+     * which will be consulted when an expression does not match
+     * any built-in parser expression types.
+     *
+     * @var string
+     */
+    protected $expressionNodeTypes = [
+        LegacyNamespaceExpressionNode::class,
+        CastingExpressionNode::class,
+        MathExpressionNode::class,
+        TernaryExpressionNode::class
+    ];
+
+    /**
+     * Alternative ExpressionNodeInterface implementers for use
+     * when put into legacy mode.
+     *
+     * @var string
+     */
+    protected $legacyExpressionNodeTypes = [
+        LegacyNamespaceExpressionNode::class
+    ];
+
+    /**
+     * @param ViewInterface $view
+     */
+    public function __construct(ViewInterface $view = null)
     {
-        return $this->objectManager;
+        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
+        if ($view) {
+            $this->view = $view;
+        }
+        $this->setTemplateParser(new TemplateParser());
+        $this->setTemplateCompiler(new TemplateCompiler());
+        $this->setViewHelperInvoker(new ViewHelperInvoker());
+        $this->setViewHelperVariableContainer(new ViewHelperVariableContainer());
+        $this->setTemplatePaths($objectManager->get(TemplatePaths::class));
+        $this->setViewHelperResolver($objectManager->get(ViewHelperResolver::class));
+        $this->setVariableProvider($objectManager->get(CmsVariableProvider::class));
+        $this->setTemplateProcessors(array(
+            $objectManager->get(XmlnsNamespaceTemplatePreProcessor::class),
+        ));
+        $cache = $objectManager->get(CacheManager::class)->getCache('fluid_template');
+        if (is_a($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['fluid_template']['frontend'], FluidTemplateCache::class, true)) {
+            $this->setCache($cache);
+        }
     }
 
     /**
-     * Injects the template variable container containing all variables available through Object Accessors
-     * in the template
+     * Set legacy compatibility mode on/off by boolean.
+     * If set to FALSE, the ViewHelperResolver will only load a limited sub-set of ExpressionNodes,
+     * making Fluid behave like the legacy version of the CMS core extension.
      *
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer The template variable container to set
+     * @param bool $legacyMode
+     * @return void
      */
-    public function injectTemplateVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer)
+    public function setLegacyMode($legacyMode)
     {
-        $this->templateVariableContainer = $templateVariableContainer;
+        $this->legacyMode = $legacyMode;
     }
 
     /**
-     * Get the template variable container
+     * @return string
+     */
+    public function getExpressionNodeTypes()
+    {
+        return $this->legacyMode ? $this->legacyExpressionNodeTypes : $this->expressionNodeTypes;
+    }
+
+    /**
+     * Returns the object manager. Only the ViewHelperNode should do this.
      *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer The Template Variable Container
+     * @return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
      */
-    public function getTemplateVariableContainer()
+    public function getObjectManager()
     {
-        return $this->templateVariableContainer;
+        return $this->objectManager;
     }
 
     /**
-     * Set the controller context which will be passed to the ViewHelper
+     * Get the template variable container (DEPRECATED; use getVariableProvider instead)
      *
-     * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext The controller context to set
+     * @deprecated since TYPO3 CMS 8, will be removed in TYPO3 CMS 9 - use getVariableProvider instead
+     * @see getVariableProvider
+     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer The Template Variable Container
      */
-    public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
+    public function getTemplateVariableContainer()
     {
-        $this->controllerContext = $controllerContext;
+        GeneralUtility::deprecationLog(
+            'getTemplateVariableContainer is deprecated since TYPO3 CMS 8, will be removed in TYPO3 CMS 9' .
+            ' - use getVariableProvider instead'
+        );
+        return $this->variableProvider;
     }
 
     /**
@@ -95,10 +181,51 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
         return $this->controllerContext;
     }
 
+    /**
+     * @param string $action
+     * @return void
+     */
+    public function setControllerAction($action)
+    {
+        $action = lcfirst(pathinfo($action, PATHINFO_FILENAME));
+        parent::setControllerAction($action);
+        $this->controllerContext->getRequest()->setControllerActionName($action);
+    }
+
+    /**
+     * @param string $controllerName
+     * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidControllerNameException
+     */
+    public function setControllerName($controllerName)
+    {
+        parent::setControllerName($controllerName);
+        $this->controllerContext->getRequest()->setControllerName($controllerName);
+    }
+
+    /**
+     * Set the controller context which will be passed to the ViewHelper
+     *
+     * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext The controller context to set
+     */
+    public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
+    {
+        $request = $controllerContext->getRequest();
+        $this->controllerContext = $controllerContext;
+        $this->setControllerAction($request->getControllerActionName());
+        // Check if Request is using a sub-package key; in which case we translate this
+        // for our RenderingContext as an emulated plain old sub-namespace controller.
+        $controllerName = $request->getControllerName();
+        if ($request->getControllerSubpackageKey() && !strpos($controllerName, '\\')) {
+            $this->setControllerName($request->getControllerSubpackageKey() . '\\' . $controllerName);
+        } else {
+            $this->setControllerName($controllerName);
+        }
+    }
+
     /**
      * Get the ViewHelperVariableContainer
      *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
+     * @return \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer
      */
     public function getViewHelperVariableContainer()
     {
diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContextInterface.php b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContextInterface.php
deleted file mode 100644
index 5f6555e6ffe7..000000000000
--- a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContextInterface.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\Rendering;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-interface RenderingContextInterface
-{
-    /**
-     * Get the template variable container
-     *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer The Template Variable Container
-     */
-    public function getTemplateVariableContainer();
-
-    /**
-     * Get the controller context which will be passed to the ViewHelper
-     *
-     * @return \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext The controller context to set
-     */
-    public function getControllerContext();
-
-    /**
-     * Get the ViewHelperVariableContainer
-     *
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
-     */
-    public function getViewHelperVariableContainer();
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Variables/CmsVariableProvider.php b/typo3/sysext/fluid/Classes/Core/Variables/CmsVariableProvider.php
new file mode 100644
index 000000000000..980b921c26a7
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/Core/Variables/CmsVariableProvider.php
@@ -0,0 +1,37 @@
+<?php
+namespace TYPO3\CMS\Fluid\Core\Variables;
+
+/*
+ * 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!
+ */
+
+/**
+ * Class CmsVariableProvider
+ */
+class CmsVariableProvider extends \TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider
+{
+    /**
+     * Get a variable by dotted path expression, retrieving the
+     * variable from nested arrays/objects one segment at a time.
+     * If the second argument is provided, it must be an array of
+     * accessor names which can be used to extract each value in
+     * the dotted path.
+     *
+     * @param string $path
+     * @param array $accessors
+     * @return mixed
+     */
+    public function getByPath($path, array $accessors = array())
+    {
+        return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath($this->variables, $path);
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractConditionViewHelper.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractConditionViewHelper.php
index ee961edee27c..7d13c0defef2 100644
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractConditionViewHelper.php
+++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractConditionViewHelper.php
@@ -1,72 +1,28 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
-use TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper;
-use TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper;
-
-/**
- * This view helper is an abstract ViewHelper which implements an if/else condition.
- * @see TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::convertArgumentValue() to find see how boolean arguments are evaluated
+/*
+ * This file is part of the TYPO3 CMS project.
  *
- * = Usage =
+ * 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.
  *
- * To create a custom Condition ViewHelper, you need to subclass this class, and
- * implement your own render() method. Inside there, you should call $this->renderThenChild()
- * if the condition evaluated to TRUE, and $this->renderElseChild() if the condition evaluated
- * to FALSE.
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
  *
- * Every Condition ViewHelper has a "then" and "else" argument, so it can be used like:
- * <[aConditionViewHelperName] .... then="condition true" else="condition false" />,
- * or as well use the "then" and "else" child nodes.
- *
- * @see TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper for a more detailed explanation and a simple usage example.
- * Make sure to NOT OVERRIDE the constructor.
- *
- * @api
+ * The TYPO3 project - inspiring people to share!
  */
-abstract class AbstractConditionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface, \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-{
-    /**
-     * An array containing child nodes
-     *
-     * @var array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode>
-     */
-    private $childNodes = array();
-
-    /**
-     * Setter for ChildNodes - as defined in ChildNodeAccessInterface
-     *
-     * @param array $childNodes Child nodes of this syntax tree node
-     * @return void
-     */
-    public function setChildNodes(array $childNodes)
-    {
-        $this->childNodes = $childNodes;
-    }
-
-    /**
-     * Initializes the "then" and "else" arguments
-     */
-    public function __construct()
-    {
-        $this->registerArgument('then', 'mixed', 'Value to be returned if the condition if met.', false);
-        $this->registerArgument('else', 'mixed', 'Value to be returned if the condition if not met.', false);
-    }
 
+/**
+ * Class AbstractConditionViewHelper
+ */
+abstract class AbstractConditionViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper
+{
     /**
-     * renders <f:then> child if $condition is true, otherwise renders <f:else> child.
+     * Renders <f:then> child if $condition is true, otherwise renders <f:else> child.
      *
+     * @param bool $condition View helper condition
      * @return string the rendered string
      * @api
      */
@@ -78,182 +34,4 @@ abstract class AbstractConditionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHel
             return $this->renderElseChild();
         }
     }
-
-    /**
-     * Returns value of "then" attribute.
-     * If then attribute is not set, iterates through child nodes and renders ThenViewHelper.
-     * If then attribute is not set and no ThenViewHelper and no ElseViewHelper is found, all child nodes are rendered
-     *
-     * @return string rendered ThenViewHelper or contents of <f:if> if no ThenViewHelper was found
-     * @api
-     */
-    protected function renderThenChild()
-    {
-        $hasEvaluated = true;
-        $result = static::renderStaticThenChild($this->arguments, $hasEvaluated);
-        if ($hasEvaluated) {
-            return $result;
-        }
-
-        $elseViewHelperEncountered = false;
-        foreach ($this->childNodes as $childNode) {
-            if ($childNode instanceof ViewHelperNode
-                && $childNode->getViewHelperClassName() === ThenViewHelper::class) {
-                $data = $childNode->evaluate($this->renderingContext);
-                return $data;
-            }
-            if ($childNode instanceof ViewHelperNode
-                && $childNode->getViewHelperClassName() === ElseViewHelper::class) {
-                $elseViewHelperEncountered = true;
-            }
-        }
-
-        if ($elseViewHelperEncountered) {
-            return '';
-        } else {
-            return $this->renderChildren();
-        }
-    }
-
-    /**
-     * Statically evalute "then" children.
-     * The "$hasEvaluated" argument is there to distinguish the case that "then" returned NULL or was not evaluated.
-     *
-     * @param array $arguments ViewHelper arguments
-     * @param bool $hasEvaluated Can be used to check if the "then" child was actually evaluated by this method.
-     * @return string
-     */
-    protected static function renderStaticThenChild($arguments, &$hasEvaluated)
-    {
-        if (isset($arguments['then'])) {
-            return $arguments['then'];
-        }
-        if (isset($arguments['__thenClosure'])) {
-            $thenClosure = $arguments['__thenClosure'];
-            return $thenClosure();
-        } elseif (isset($arguments['__elseClosure'])) {
-            return '';
-        }
-
-        $hasEvaluated = false;
-    }
-
-    /**
-     * Returns value of "else" attribute.
-     * If else attribute is not set, iterates through child nodes and renders ElseViewHelper.
-     * If else attribute is not set and no ElseViewHelper is found, an empty string will be returned.
-     *
-     * @return string rendered ElseViewHelper or an empty string if no ThenViewHelper was found
-     * @api
-     */
-    protected function renderElseChild()
-    {
-        $hasEvaluated = true;
-        $result = static::renderStaticElseChild($this->arguments, $hasEvaluated);
-        if ($hasEvaluated) {
-            return $result;
-        }
-
-        foreach ($this->childNodes as $childNode) {
-            if ($childNode instanceof ViewHelperNode
-                && $childNode->getViewHelperClassName() === ElseViewHelper::class) {
-                return $childNode->evaluate($this->renderingContext);
-            }
-        }
-
-        return '';
-    }
-
-    /**
-     * Statically evalute "else" children.
-     * The "$hasEvaluated" argument is there to distinguish the case that "else" returned NULL or was not evaluated.
-     *
-     * @param array $arguments ViewHelper arguments
-     * @param bool $hasEvaluated Can be used to check if the "else" child was actually evaluated by this method.
-     * @return string
-     */
-    protected static function renderStaticElseChild($arguments, &$hasEvaluated)
-    {
-        if (isset($arguments['else'])) {
-            return $arguments['else'];
-        }
-        if (isset($arguments['__elseClosure'])) {
-            $elseClosure = $arguments['__elseClosure'];
-            return $elseClosure();
-        }
-
-        $hasEvaluated = false;
-    }
-
-    /**
-     * The compiled ViewHelper adds two new ViewHelper arguments: __thenClosure and __elseClosure.
-     * These contain closures which are be executed to render the then(), respectively else() case.
-     *
-     * @param string $argumentsVariableName
-     * @param string $renderChildrenClosureVariableName
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     * @internal
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
-    {
-        foreach ($syntaxTreeNode->getChildNodes() as $childNode) {
-            if ($childNode instanceof ViewHelperNode
-                && $childNode->getViewHelperClassName() === ThenViewHelper::class) {
-                $childNodesAsClosure = $templateCompiler->wrapChildNodesInClosure($childNode);
-                $initializationPhpCode .= sprintf('%s[\'__thenClosure\'] = %s;', $argumentsVariableName, $childNodesAsClosure) . LF;
-            }
-            if ($childNode instanceof ViewHelperNode
-                && $childNode->getViewHelperClassName() === ElseViewHelper::class) {
-                $childNodesAsClosure = $templateCompiler->wrapChildNodesInClosure($childNode);
-                $initializationPhpCode .= sprintf('%s[\'__elseClosure\'] = %s;', $argumentsVariableName, $childNodesAsClosure) . LF;
-            }
-        }
-
-        return sprintf('%s::renderStatic(%s, %s, $renderingContext)',
-            get_class($this), $argumentsVariableName, $renderChildrenClosureVariableName);
-    }
-
-    /**
-     * Default implementation for CompilableInterface. See CompilableInterface
-     * for a detailed description of this method.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed
-     * @see \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $hasEvaluated = true;
-        if (static::evaluateCondition($arguments)) {
-            $result = static::renderStaticThenChild($arguments, $hasEvaluated);
-            if ($hasEvaluated) {
-                return $result;
-            }
-
-            return $renderChildrenClosure();
-        } else {
-            $result = static::renderStaticElseChild($arguments, $hasEvaluated);
-            if ($hasEvaluated) {
-                return $result;
-            }
-        }
-
-        return '';
-    }
-
-    /**
-     * This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality.
-     *
-     * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method.
-     * @return bool
-     */
-    protected static function evaluateCondition($arguments = null)
-    {
-        return (isset($arguments['condition']) && $arguments['condition']);
-    }
 }
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php
index 83809b78cb5a..dc1ec6b356c4 100644
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php
+++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Tag based view helper.
@@ -18,7 +21,7 @@ namespace TYPO3\CMS\Fluid\Core\ViewHelper;
  *
  * @api
  */
-abstract class AbstractTagBasedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
+abstract class AbstractTagBasedViewHelper extends AbstractViewHelper
 {
     /**
      * Names of all registered tag attributes
@@ -27,15 +30,6 @@ abstract class AbstractTagBasedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelp
      */
     private static $tagAttributes = array();
 
-    /**
-     * Tag builder instance
-     *
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder
-     * @inject
-     * @api
-     */
-    protected $tag = null;
-
     /**
      * name of the tag to be created by this view helper
      *
@@ -44,15 +38,34 @@ abstract class AbstractTagBasedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelp
      */
     protected $tagName = 'div';
 
+    /**
+     * @var TagBuilder
+     */
+    protected $tag;
+
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
+
+    /**
+     * Constructor
+     */
+    public function __construct()
+    {
+        $this->tag = new TagBuilder();
+    }
+
     /**
      * Constructor
      *
      * @api
      */
-    public function __construct()
+    public function initializeArguments()
     {
         $this->registerArgument('additionalAttributes', 'array', 'Additional tag attributes. They will be added directly to the resulting HTML tag.', false);
         $this->registerArgument('data', 'array', 'Additional data-* attributes. They will each be added with a "data-" prefix.', false);
+        parent::initializeArguments();
     }
 
     /**
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
index d1b1ad2f2c3d..6cc5528d007f 100644
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
+++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
@@ -1,15 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 use Psr\Log\LoggerInterface;
 use TYPO3\CMS\Core\Log\LogManager;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -19,7 +23,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  *
  * @api
  */
-abstract class AbstractViewHelper
+abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper implements ViewHelperInterface
 {
     /**
      * TRUE if arguments have already been initialized
@@ -28,13 +32,6 @@ abstract class AbstractViewHelper
      */
     private $argumentsInitialized = false;
 
-    /**
-     * Stores all \TYPO3\CMS\Fluid\ArgumentDefinition instances
-     *
-     * @var array
-     */
-    private $argumentDefinitions = array();
-
     /**
      * Cache of argument definitions; the key is the ViewHelper class name, and the
      * value is the array of argument definitions.
@@ -46,21 +43,6 @@ abstract class AbstractViewHelper
      */
     private static $argumentDefinitionCache = array();
 
-    /**
-     * Current view helper node
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
-     */
-    private $viewHelperNode;
-
-    /**
-     * Arguments array.
-     *
-     * @var array
-     * @api
-     */
-    protected $arguments;
-
     /**
      * Current variable container reference.
      *
@@ -108,22 +90,6 @@ abstract class AbstractViewHelper
      */
     protected $objectManager;
 
-    /**
-     * With this flag, you can disable the escaping interceptor inside this ViewHelper.
-     * THIS MIGHT CHANGE WITHOUT NOTICE, NO PUBLIC API!
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = true;
-
-    /**
-     * @param array $arguments
-     * @return void
-     */
-    public function setArguments(array $arguments)
-    {
-        $this->arguments = $arguments;
-    }
-
     /**
      * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
      * @return void
@@ -131,10 +97,8 @@ abstract class AbstractViewHelper
     public function setRenderingContext(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
     {
         $this->renderingContext = $renderingContext;
-        $this->templateVariableContainer = $renderingContext->getTemplateVariableContainer();
-        if ($renderingContext->getControllerContext() !== null) {
-            $this->controllerContext = $renderingContext->getControllerContext();
-        }
+        $this->controllerContext = $renderingContext->getControllerContext();
+        $this->templateVariableContainer = $renderingContext->getVariableProvider();
         $this->viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
     }
 
@@ -148,18 +112,6 @@ abstract class AbstractViewHelper
         $this->reflectionService = $reflectionService;
     }
 
-    /**
-     * Returns whether the escaping interceptor should be disabled or enabled inside the tags contents.
-     *
-     * THIS METHOD MIGHT CHANGE WITHOUT NOTICE; NO PUBLIC API!
-     *
-     * @return bool
-     */
-    public function isEscapingInterceptorEnabled()
-    {
-        return $this->escapingInterceptorEnabled;
-    }
-
     /**
      * Register a new argument. Call this method from your ViewHelper subclass
      * inside the initializeArguments() method.
@@ -169,14 +121,14 @@ abstract class AbstractViewHelper
      * @param string $description Description of the argument
      * @param bool $required If TRUE, argument is required. Defaults to FALSE.
      * @param mixed $defaultValue Default value of argument
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $this, to allow chaining.
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
+     * @return ViewHelperInterface $this, to allow chaining.
+     * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
      * @api
      */
     protected function registerArgument($name, $type, $description, $required = false, $defaultValue = null)
     {
         if (array_key_exists($name, $this->argumentDefinitions)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('Argument "' . $name . '" has already been defined, thus it should not be defined again.', 1253036401);
+            throw new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception('Argument "' . $name . '" has already been defined, thus it should not be defined again.', 1253036401);
         }
         $this->argumentDefinitions[$name] = new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition($name, $type, $description, $required, $defaultValue);
         return $this;
@@ -192,8 +144,8 @@ abstract class AbstractViewHelper
      * @param string $description Description of the argument
      * @param bool $required If TRUE, argument is required. Defaults to FALSE.
      * @param mixed $defaultValue Default value of argument
-     * @return \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $this, to allow chaining.
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
+     * @return ViewHelperInterface $this, to allow chaining.
+     * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
      * @api
      */
     protected function overrideArgument($name, $type, $description, $required = false, $defaultValue = null)
@@ -205,19 +157,6 @@ abstract class AbstractViewHelper
         return $this;
     }
 
-    /**
-     * Sets all needed attributes needed for the rendering. Called by the
-     * framework. Populates $this->viewHelperNode.
-     * This is PURELY INTERNAL! Never override this method!!
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node View Helper node to be set.
-     * @return void
-     */
-    public function setViewHelperNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
-    {
-        $this->viewHelperNode = $node;
-    }
-
     /**
      * Called when being inside a cached template.
      *
@@ -321,63 +260,37 @@ abstract class AbstractViewHelper
         };
     }
 
-    /**
-     * Initialize all arguments and return them
-     *
-     * @return array Array of \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition instances.
-     */
-    public function prepareArguments()
-    {
-        if (!$this->argumentsInitialized) {
-            $thisClassName = get_class($this);
-            if (isset(self::$argumentDefinitionCache[$thisClassName])) {
-                $this->argumentDefinitions = self::$argumentDefinitionCache[$thisClassName];
-            } else {
-                $this->registerRenderMethodArguments();
-                $this->initializeArguments();
-                self::$argumentDefinitionCache[$thisClassName] = $this->argumentDefinitions;
-            }
-            $this->argumentsInitialized = true;
-        }
-        return $this->argumentDefinitions;
-    }
-
     /**
      * Register method arguments for "render" by analysing the doc comment above.
      *
      * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\Parser\Exception
+     * @throws \TYPO3Fluid\Fluid\Core\Parser\Exception
      */
-    private function registerRenderMethodArguments()
+    protected function registerRenderMethodArguments()
     {
         $methodParameters = $this->reflectionService->getMethodParameters(get_class($this), 'render');
         if (count($methodParameters) === 0) {
             return;
         }
 
-        if (\TYPO3\CMS\Fluid\Fluid::$debugMode) {
-            $methodTags = $this->reflectionService->getMethodTagsValues(get_class($this), 'render');
+        $methodTags = $this->reflectionService->getMethodTagsValues(get_class($this), 'render');
 
-            $paramAnnotations = array();
-            if (isset($methodTags['param'])) {
-                $paramAnnotations = $methodTags['param'];
-            }
+        $paramAnnotations = array();
+        if (isset($methodTags['param'])) {
+            $paramAnnotations = $methodTags['param'];
         }
 
         $i = 0;
         foreach ($methodParameters as $parameterName => $parameterInfo) {
             $dataType = null;
             if (isset($parameterInfo['type'])) {
-                $dataType = $parameterInfo['type'];
-            } elseif ($parameterInfo['array']) {
-                $dataType = 'array';
-            }
-            if ($dataType === null) {
-                throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('could not determine type of argument "' . $parameterName . '" of the render-method in ViewHelper "' . get_class($this) . '". Either the methods docComment is invalid or some PHP optimizer strips off comments.', 1242292003);
+                $dataType = isset($parameterInfo['array']) && (bool)$parameterInfo['array'] ? 'array' : $parameterInfo['type'];
+            } else {
+                throw new \TYPO3\CMS\Fluid\Core\Exception('Could not determine type of argument "' . $parameterName . '" of the render-method in ViewHelper "' . get_class($this) . '". Either the methods docComment is invalid or some PHP optimizer strips off comments.', 1242292003);
             }
 
             $description = '';
-            if (\TYPO3\CMS\Fluid\Fluid::$debugMode && isset($paramAnnotations[$i])) {
+            if (isset($paramAnnotations[$i])) {
                 $explodedAnnotation = explode(' ', $paramAnnotations[$i]);
                 array_shift($explodedAnnotation);
                 array_shift($explodedAnnotation);
@@ -387,130 +300,20 @@ abstract class AbstractViewHelper
             if (isset($parameterInfo['defaultValue'])) {
                 $defaultValue = $parameterInfo['defaultValue'];
             }
-            $this->argumentDefinitions[$parameterName] = new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition($parameterName, $dataType, $description, ($parameterInfo['optional'] === false), $defaultValue, true);
+            $this->argumentDefinitions[$parameterName] = new ArgumentDefinition($parameterName, $dataType, $description, ($parameterInfo['optional'] === false), $defaultValue, true);
             $i++;
         }
     }
 
     /**
-     * Validate arguments, and throw exception if arguments do not validate.
-     *
-     * @return void
-     * @throws \InvalidArgumentException
+     * @return \TYPO3Fluid\Fluid\Core\ViewHelper\ArgumentDefinition[]
+     * @throws \TYPO3Fluid\Fluid\Core\Parser\Exception
      */
-    public function validateArguments()
+    public function prepareArguments()
     {
-        $argumentDefinitions = $this->prepareArguments();
-        if (!count($argumentDefinitions)) {
-            return;
+        if (method_exists($this, 'registerRenderMethodArguments')) {
+            $this->registerRenderMethodArguments();
         }
-        foreach ($argumentDefinitions as $argumentName => $registeredArgument) {
-            if ($this->hasArgument($argumentName)) {
-                if ($this->arguments[$argumentName] === $registeredArgument->getDefaultValue()) {
-                    continue;
-                }
-
-                $type = $registeredArgument->getType();
-                if ($type === 'array') {
-                    if (!is_array($this->arguments[$argumentName]) && !$this->arguments[$argumentName] instanceof \ArrayAccess && !$this->arguments[$argumentName] instanceof \Traversable) {
-                        throw new \InvalidArgumentException('The argument "' . $argumentName . '" was registered with type "array", but is of type "' . gettype($this->arguments[$argumentName]) . '" in view helper "' . get_class($this) . '"', 1237900529);
-                    }
-                } elseif ($type === 'boolean') {
-                    if (!is_bool($this->arguments[$argumentName])) {
-                        throw new \InvalidArgumentException('The argument "' . $argumentName . '" was registered with type "boolean", but is of type "' . gettype($this->arguments[$argumentName]) . '" in view helper "' . get_class($this) . '".', 1240227732);
-                    }
-                } elseif (class_exists($type, false)) {
-                    if (!($this->arguments[$argumentName] instanceof $type)) {
-                        if (is_object($this->arguments[$argumentName])) {
-                            throw new \InvalidArgumentException('The argument "' . $argumentName . '" was registered with type "' . $type . '", but is of type "' . get_class($this->arguments[$argumentName]) . '" in view helper "' . get_class($this) . '".', 1256475114);
-                        } else {
-                            throw new \InvalidArgumentException('The argument "' . $argumentName . '" was registered with type "' . $type . '", but is of type "' . gettype($this->arguments[$argumentName]) . '" in view helper "' . get_class($this) . '".', 1256475113);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Initialize all arguments. You need to override this method and call
-     * $this->registerArgument(...) inside this method, to register all your arguments.
-     *
-     * @return void
-     * @api
-     */
-    public function initializeArguments()
-    {
-    }
-
-    /**
-     * Render method you need to implement for your custom view helper.
-     * Available objects at this point are $this->arguments, and $this->templateVariableContainer.
-     *
-     * Besides, you often need $this->renderChildren().
-     *
-     * @return string rendered string, view helper specific
-     * @api
-     */
-    //abstract public function render();
-
-    /**
-     * Tests if the given $argumentName is set, and not NULL.
-     *
-     * @param string $argumentName
-     * @return bool TRUE if $argumentName is found, FALSE otherwise
-     * @api
-     */
-    protected function hasArgument($argumentName)
-    {
-        return isset($this->arguments[$argumentName]) && $this->arguments[$argumentName] !== null;
-    }
-
-    /**
-     * Default implementation for CompilableInterface. By default,
-     * inserts a renderStatic() call to itself.
-     *
-     * You only should override this method *when you absolutely know what you
-     * are doing*, and really want to influence the generated PHP code during
-     * template compilation directly.
-     *
-     * @param string $argumentsVariableName
-     * @param string $renderChildrenClosureVariableName
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     * @see \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
-    {
-        return sprintf('%s::renderStatic(%s, %s, $renderingContext)',
-                get_class($this), $argumentsVariableName, $renderChildrenClosureVariableName);
-    }
-
-    /**
-     * Default implementation for CompilableInterface. See CompilableInterface
-     * for a detailed description of this method.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return mixed
-     * @see \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        return null;
-    }
-
-    /**
-     * Resets the ViewHelper state.
-     *
-     * Overwrite this method if you need to get a clean state of your ViewHelper.
-     *
-     * @return void
-     */
-    public function resetState()
-    {
+        return parent::prepareArguments();
     }
 }
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/ArgumentDefinition.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/ArgumentDefinition.php
index 8cfca222bb8d..cc2b5054a9cf 100644
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/ArgumentDefinition.php
+++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/ArgumentDefinition.php
@@ -1,56 +1,31 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Argument definition of each view helper argument
+ *
+ * This subclass of ArgumentDefinition from Fluid has
+ * one additional capability: defining that an argument
+ * should be expected as a parameter for the render()
+ * method - which means the ViewHelperInvoker will be
+ * processing it a bit differently. Other than this it
+ * is a normal Fluid ArgumentDefinition.
  */
-class ArgumentDefinition
+class ArgumentDefinition extends \TYPO3Fluid\Fluid\Core\ViewHelper\ArgumentDefinition
 {
-    /**
-     * Name of argument
-     *
-     * @var string
-     */
-    protected $name;
-
-    /**
-     * Type of argument
-     *
-     * @var string
-     */
-    protected $type;
-
-    /**
-     * Description of argument
-     *
-     * @var string
-     */
-    protected $description;
-
-    /**
-     * Is argument required?
-     *
-     * @var bool
-     */
-    protected $required = false;
-
-    /**
-     * Default value for argument
-     *
-     * @var mixed
-     */
-    protected $defaultValue = null;
-
     /**
      * TRUE if it is a method parameter
      *
@@ -78,56 +53,6 @@ class ArgumentDefinition
         $this->isMethodParameter = $isMethodParameter;
     }
 
-    /**
-     * Get the name of the argument
-     *
-     * @return string Name of argument
-     */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /**
-     * Get the type of the argument
-     *
-     * @return string Type of argument
-     */
-    public function getType()
-    {
-        return $this->type;
-    }
-
-    /**
-     * Get the description of the argument
-     *
-     * @return string Description of argument
-     */
-    public function getDescription()
-    {
-        return $this->description;
-    }
-
-    /**
-     * Get the optionality of the argument
-     *
-     * @return bool TRUE if argument is optional
-     */
-    public function isRequired()
-    {
-        return $this->required;
-    }
-
-    /**
-     * Get the default value, if set
-     *
-     * @return mixed Default value
-     */
-    public function getDefaultValue()
-    {
-        return $this->defaultValue;
-    }
-
     /**
      * TRUE if it is a method parameter
      *
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Arguments.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Arguments.php
deleted file mode 100644
index 2df3af30feb1..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Arguments.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * Arguments list. Wraps an array, but only allows read-only methods on it.
- * Is available inside every view helper as $this->arguments - and you use it as if it was an array.
- * However, you can only read, and not write to it.
- *
- * @api
- */
-class Arguments implements \ArrayAccess
-{
-    /**
-     * @var array the arguments themselves
-     */
-    protected $arguments = array();
-
-    /**
-     * Constructor.
-     *
-     * @param array $arguments Array of arguments
-     * @api
-     */
-    public function __construct(array $arguments)
-    {
-        $this->arguments = $arguments;
-    }
-
-    /**
-     * Checks if a given key exists in the array
-     *
-     * @param string $key Key to check
-     * @return bool true if exists
-     */
-    public function offsetExists($key)
-    {
-        return array_key_exists($key, $this->arguments);
-    }
-
-    /**
-     * Returns the value to the given key.
-     *
-     * @param string $key Key to get.
-     * @return object associated value
-     */
-    public function offsetGet($key)
-    {
-        if (!array_key_exists($key, $this->arguments)) {
-            return null;
-        }
-        return $this->arguments[$key];
-    }
-
-    /**
-     * Throw exception if you try to set a value.
-     *
-     * @param string $key
-     * @param object $value
-     */
-    public function offsetSet($key, $value)
-    {
-        throw new \TYPO3\CMS\Fluid\Core\Exception('Tried to set argument "' . $key . '", but setting arguments is forbidden.', 1236080693);
-    }
-
-    /**
-     * Throw exception if you try to unset a value.
-     *
-     * @param string $key
-     */
-    public function offsetUnset($key)
-    {
-        throw new \TYPO3\CMS\Fluid\Core\Exception('Tried to unset argument "' . $key . '", but setting arguments is forbidden.', 1236080702);
-    }
-
-    /**
-     * Checks if an argument with the specified name exists
-     *
-     * @param string $argumentName Name of the argument to check for
-     * @return bool TRUE if such an argument exists, otherwise FALSE
-     * @see offsetExists()
-     */
-    public function hasArgument($argumentName)
-    {
-        return $this->offsetExists($argumentName) && $this->arguments[$argumentName] !== null;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception.php
deleted file mode 100644
index c4d6b4daff15..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A ViewHelper Exception
- *
- * @api
- */
-class Exception extends \TYPO3\CMS\Fluid\Core\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/InvalidVariableException.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/InvalidVariableException.php
deleted file mode 100644
index da498224338f..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/InvalidVariableException.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A "Invalid Variable" exception.
- *
- * @api
- */
-class InvalidVariableException extends \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/RenderingContextNotAccessibleException.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/RenderingContextNotAccessibleException.php
deleted file mode 100644
index 2f0cfc5d575f..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Exception/RenderingContextNotAccessibleException.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A "Rendering Context not Accessible" exception.
- *
- * @api
- */
-class RenderingContextNotAccessibleException extends \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/ChildNodeAccessInterface.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/ChildNodeAccessInterface.php
deleted file mode 100644
index 7b20c1d89876..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/ChildNodeAccessInterface.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper\Facets;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Child Node Access Facet. View Helpers should implement this interface if they
- * need access to the direct children in the Syntax Tree at rendering-time.
- * This might happen if you only want to selectively render a part of the syntax
- * tree depending on some conditions.
- * To render subnodes, you can fetch the RenderingContext via $this->renderingContext.
- *
- * In most cases, you will not need this facet, and it is NO PUBLIC API!
- * Right now it is only used internally for conditions, so by subclassing TYPO3\CMS\Fluid\Core\ViewHelpers\AbstractConditionViewHelper, this should be all you need.
- *
- * See \TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper for an example how it is used.
- */
-interface ChildNodeAccessInterface
-{
-    /**
-     * Sets the direct child nodes of the current syntax tree node.
-     *
-     * @param array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode> $childNodes
-     * @return void
-     */
-    public function setChildNodes(array $childNodes);
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/CompilableInterface.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/CompilableInterface.php
deleted file mode 100644
index 98a1bceb61ec..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/CompilableInterface.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper\Facets;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * If a ViewHelper implements CompilableInterface, it can directly influence the way
- * the syntax tree is compiled to a static PHP file.
- *
- * For now, this class is NO API.
- *
- * There a two ways of using the Compilable Interface.
- *
- * Implementing renderStatic()
- * ===========================
- * A ViewHelper which implements CompilableInterface and the renderStatic method
- * is called *statically* through the renderStatic method; and no instance of the
- * ViewHelper is created.
- *
- * This is a case which you can implement if you do not access any *internal state*
- * in the ViewHelper. This means the following should be true:
- *
- * - you do not access $this->arguments, but only the function arguments of render()
- * - you do not call $this->renderChildren()
- *
- * If you have performance problems because the calling overhead of a ViewHelper
- * is too big, you should implement renderStatic().
- *
- * Implementing compile()
- * ======================
- *
- * Some ViewHelpers want to directly manipulate the PHP code which is created in
- * the compilation run. This is, however, only necessary in very special cases,
- * like in the AbstractConditionViewHelper or when a ViewHelper is potentially
- * called thousands of times.
- *
- * A ViewHelper which wants to directly influence the resulting PHP code must implement
- * the CompilableInterface, and only implement the compile() method.
- */
-interface CompilableInterface
-{
-    /**
-     * Here follows a more detailed description of the arguments of this function:
-     *
-     * $arguments contains a plain array of all arguments this ViewHelper has received,
-     * including the default argument values if an argument has not been specified
-     * in the ViewHelper invocation.
-     *
-     * $renderChildrenClosure is a closure you can execute instead of $this->renderChildren().
-     * It returns the rendered child nodes, so you can simply do $renderChildrenClosure() to execute
-     * it. It does not take any parameters.
-     *
-     * $renderingContext contains references to the TemplateVariableContainer, the
-     * ViewHelperVariableContainer and the ControllerContext.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string the resulting string which is directly shown
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext);
-
-    /**
-     * This method is called on compilation time.
-     *
-     * It has to return a *single* PHP statement without semi-colon or newline
-     * at the end, which will be embedded at various places.
-     *
-     * Furthermore, it can append PHP code to the variable $initializationPhpCode.
-     * In this case, all statements have to end with semi-colon and newline.
-     *
-     * Outputting new variables
-     * ========================
-     * If you want create a new PHP variable, you need to use
-     * $templateCompiler->variableName('nameOfVariable') for this, as all variables
-     * need to be globally unique.
-     *
-     * Return Value
-     * ============
-     * Besides returning a single string, it can also return the constant
-     * \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler::SHOULD_GENERATE_VIEWHELPER_INVOCATION
-     * which means that after the $initializationPhpCode, the ViewHelper invocation
-     * is built as normal. This is especially needed if you want to build new arguments
-     * at run-time, as it is done for the AbstractConditionViewHelper.
-     *
-     * @param string $argumentsVariableName Name of the variable in which the ViewHelper arguments are stored
-     * @param string $renderChildrenClosureVariableName Name of the closure which can be executed to render the child nodes
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler);
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/PostParseInterface.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/PostParseInterface.php
deleted file mode 100644
index 4d98b5b931fb..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/Facets/PostParseInterface.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper\Facets;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Post Parse Facet. Your view helper should implement this if you want a callback
- * to be called directly after the syntax tree node corresponding to this view
- * helper has been built.
- *
- * In the callback, it is possible to store some variables inside the
- * parseVariableContainer (which is different from the runtime variable container!).
- * This implicates that you usually have to adjust the \TYPO3\CMS\Fluid\View\TemplateView
- * in case you implement this facet.
- *
- * Normally, this facet is not needed, except in really really rare cases.
- */
-interface PostParseInterface
-{
-    /**
-     * Callback which is called directly after the corresponding syntax tree
-     * node to this view helper has been built.
-     * This is a parse-time callback, which does not change the rendering of a
-     * view helper.
-     *
-     * You can store some data inside the variableContainer given here, which
-     * can be used f.e. inside the TemplateView.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode The current node in the syntax tree corresponding to this view helper.
-     * @param array $viewHelperArguments View helper arguments as an array of SyntaxTrees. If you really need an argument, make sure to call $viewHelperArguments[$argName]->render(...)!
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer Variable container you can use to pass on some variables to the view.
-     * @return void
-     */
-    public static function postParseEvent(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode, array $viewHelperArguments, \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer);
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/TagBuilder.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/TagBuilder.php
deleted file mode 100644
index 64111f6474b0..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/TagBuilder.php
+++ /dev/null
@@ -1,253 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Tag builder. Can be easily accessed in AbstractTagBasedViewHelper
- *
- * @api
- */
-class TagBuilder
-{
-    /**
-     * Name of the Tag to be rendered
-     *
-     * @var string
-     */
-    protected $tagName = '';
-
-    /**
-     * Content of the tag to be rendered
-     *
-     * @var string
-     */
-    protected $content = '';
-
-    /**
-     * Attributes of the tag to be rendered
-     *
-     * @var array
-     */
-    protected $attributes = array();
-
-    /**
-     * Specifies whether this tag needs a closing tag.
-     * E.g. <textarea> cant be self-closing even if its empty
-     *
-     * @var bool
-     */
-    protected $forceClosingTag = false;
-
-    /**
-     * Constructor
-     *
-     * @param string $tagName name of the tag to be rendered
-     * @param string $tagContent content of the tag to be rendered
-     * @api
-     */
-    public function __construct($tagName = '', $tagContent = '')
-    {
-        $this->setTagName($tagName);
-        $this->setContent($tagContent);
-    }
-
-    /**
-     * Sets the tag name
-     *
-     * @param string $tagName name of the tag to be rendered
-     * @return void
-     * @api
-     */
-    public function setTagName($tagName)
-    {
-        $this->tagName = $tagName;
-    }
-
-    /**
-     * Gets the tag name
-     *
-     * @return string tag name of the tag to be rendered
-     * @api
-     */
-    public function getTagName()
-    {
-        return $this->tagName;
-    }
-
-    /**
-     * Sets the content of the tag
-     *
-     * @param string $tagContent content of the tag to be rendered
-     * @return void
-     * @api
-     */
-    public function setContent($tagContent)
-    {
-        $this->content = $tagContent;
-    }
-
-    /**
-     * Gets the content of the tag
-     *
-     * @return string content of the tag to be rendered
-     * @api
-     */
-    public function getContent()
-    {
-        return $this->content;
-    }
-
-    /**
-     * Returns TRUE if tag contains content, otherwise FALSE
-     *
-     * @return bool TRUE if tag contains text, otherwise FALSE
-     * @api
-     */
-    public function hasContent()
-    {
-        if ($this->content === null) {
-            return false;
-        }
-        return $this->content !== '';
-    }
-
-    /**
-     * Set this to TRUE to force a closing tag
-     * E.g. <textarea> cant be self-closing even if its empty
-     *
-     * @param bool $forceClosingTag
-     * @api
-     */
-    public function forceClosingTag($forceClosingTag)
-    {
-        $this->forceClosingTag = $forceClosingTag;
-    }
-
-    /**
-     * Returns TRUE if the tag has an attribute with the given name
-     *
-     * @param string $attributeName name of the attribute
-     * @return bool TRUE if the tag has an attribute with the given name, otherwise FALSE
-     * @api
-     */
-    public function hasAttribute($attributeName)
-    {
-        return array_key_exists($attributeName, $this->attributes);
-    }
-
-    /**
-     * Get an attribute from the $attributes-collection
-     *
-     * @param string $attributeName name of the attribute
-     * @return string The attribute value or NULL if the attribute is not registered
-     * @api
-     */
-    public function getAttribute($attributeName)
-    {
-        if (!$this->hasAttribute($attributeName)) {
-            return null;
-        }
-        return $this->attributes[$attributeName];
-    }
-
-    /**
-     * Get all attribute from the $attributes-collection
-     *
-     * @return array Attributes indexed by attribute name
-     * @api
-     */
-    public function getAttributes()
-    {
-        return $this->attributes;
-    }
-
-    /**
-     * Adds an attribute to the $attributes-collection
-     *
-     * @param string $attributeName name of the attribute to be added to the tag
-     * @param string $attributeValue attribute value
-     * @param bool $escapeSpecialCharacters apply htmlspecialchars to attribute value
-     * @return void
-     * @api
-     */
-    public function addAttribute($attributeName, $attributeValue, $escapeSpecialCharacters = true)
-    {
-        if ($escapeSpecialCharacters) {
-            $attributeValue = htmlspecialchars($attributeValue);
-        }
-        $this->attributes[$attributeName] = $attributeValue;
-    }
-
-    /**
-     * Adds attributes to the $attributes-collection
-     *
-     * @param array $attributes collection of attributes to add. key = attribute name, value = attribute value
-     * @param bool $escapeSpecialCharacters apply htmlspecialchars to attribute values#
-     * @return void
-     * @api
-     */
-    public function addAttributes(array $attributes, $escapeSpecialCharacters = true)
-    {
-        foreach ($attributes as $attributeName => $attributeValue) {
-            $this->addAttribute($attributeName, $attributeValue, $escapeSpecialCharacters);
-        }
-    }
-
-    /**
-     * Removes an attribute from the $attributes-collection
-     *
-     * @param string $attributeName name of the attribute to be removed from the tag
-     * @return void
-     * @api
-     */
-    public function removeAttribute($attributeName)
-    {
-        unset($this->attributes[$attributeName]);
-    }
-
-    /**
-     * Resets the TagBuilder by setting all members to their default value
-     *
-     * @return void
-     * @api
-     */
-    public function reset()
-    {
-        $this->tagName = '';
-        $this->content = '';
-        $this->attributes = array();
-        $this->forceClosingTag = false;
-    }
-
-    /**
-     * Renders and returns the tag
-     *
-     * @return string
-     * @api
-     */
-    public function render()
-    {
-        if (empty($this->tagName)) {
-            return '';
-        }
-        $output = '<' . $this->tagName;
-        foreach ($this->attributes as $attributeName => $attributeValue) {
-            $output .= ' ' . $attributeName . '="' . $attributeValue . '"';
-        }
-        if ($this->hasContent() || $this->forceClosingTag) {
-            $output .= '>' . $this->content . '</' . $this->tagName . '>';
-        } else {
-            $output .= ' />';
-        }
-        return $output;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/TemplateVariableContainer.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/TemplateVariableContainer.php
deleted file mode 100644
index 117521a04b3b..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/TemplateVariableContainer.php
+++ /dev/null
@@ -1,213 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * VariableContainer which stores template variables.
- * Is used in two contexts:
- *
- * 1) Holds the current variables in the template
- * 2) Holds variables being set during Parsing (set in view helpers implementing the PostParse facet)
- *
- * @api
- */
-class TemplateVariableContainer implements \ArrayAccess
-{
-    /**
-     * List of reserved words that can't be used as variable identifiers in Fluid templates
-     *
-     * @var array
-     */
-    protected static $reservedVariableNames = array('true', 'false', 'on', 'off', 'yes', 'no', '_all');
-
-    /**
-     * Variables stored in context
-     *
-     * @var array
-     */
-    protected $variables = array();
-
-    /**
-     * Constructor. Can take an array, and initializes the variables with it.
-     *
-     * @param array $variableArray
-     * @api
-     */
-    public function __construct(array $variableArray = array())
-    {
-        $this->variables = $variableArray;
-    }
-
-    /**
-     * Add a variable to the context
-     *
-     * @param string $identifier Identifier of the variable to add
-     * @param mixed $value The variable's value
-     * @return void
-     * @throws Exception\InvalidVariableException
-     * @api
-     */
-    public function add($identifier, $value)
-    {
-        if (array_key_exists($identifier, $this->variables)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('Duplicate variable declaration, "' . $identifier . '" already set!', 1224479063);
-        }
-        if (in_array(strtolower($identifier), self::$reservedVariableNames)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('"' . $identifier . '" is a reserved variable name and cannot be used as variable identifier.', 1256730379);
-        }
-        $this->variables[$identifier] = $value;
-    }
-
-    /**
-     * Get a variable from the context. Throws exception if variable is not found in context.
-     *
-     * If "_all" is given as identifier, all variables are returned in an array.
-     *
-     * @param string $identifier
-     * @return mixed The variable value identified by $identifier
-     * @throws Exception\InvalidVariableException
-     * @api
-     */
-    public function get($identifier)
-    {
-        if ($identifier === '_all') {
-            return $this->variables;
-        }
-        if (!array_key_exists($identifier, $this->variables)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('Tried to get a variable "' . $identifier . '" which is not stored in the context!', 1224479370);
-        }
-        return $this->variables[$identifier];
-    }
-
-    /**
-     * Remove a variable from context. Throws exception if variable is not found in context.
-     *
-     * @param string $identifier The identifier to remove
-     * @return void
-     * @throws Exception\InvalidVariableException
-     * @api
-     */
-    public function remove($identifier)
-    {
-        if (!array_key_exists($identifier, $this->variables)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('Tried to remove a variable "' . $identifier . '" which is not stored in the context!', 1224479372);
-        }
-        unset($this->variables[$identifier]);
-    }
-
-    /**
-     * Returns an array of all identifiers available in the context.
-     *
-     * @return array Array of identifier strings
-     */
-    public function getAllIdentifiers()
-    {
-        return array_keys($this->variables);
-    }
-
-    /**
-     * Returns the variables array.
-     *
-     * @return array Identifiers and values of all variables
-     */
-    public function getAll()
-    {
-        return $this->variables;
-    }
-
-    /**
-     * Checks if this property exists in the VariableContainer.
-     *
-     * @param string $identifier
-     * @return bool TRUE if $identifier exists, FALSE otherwise
-     * @api
-     */
-    public function exists($identifier)
-    {
-        if ($identifier === '_all') {
-            return true;
-        }
-
-        return array_key_exists($identifier, $this->variables);
-    }
-
-    /**
-     * Clean up for serializing.
-     *
-     * @return array
-     */
-    public function __sleep()
-    {
-        return array('variables');
-    }
-
-    /**
-     * Adds a variable to the context.
-     *
-     * @param string $identifier Identifier of the variable to add
-     * @param mixed $value The variable's value
-     * @return void
-     */
-    public function offsetSet($identifier, $value)
-    {
-        $this->add($identifier, $value);
-    }
-
-    /**
-     * Remove a variable from context. Throws exception if variable is not found in context.
-     *
-     * @param string $identifier The identifier to remove
-     * @return void
-     */
-    public function offsetUnset($identifier)
-    {
-        $this->remove($identifier);
-    }
-
-    /**
-     * Checks if this property exists in the VariableContainer.
-     *
-     * @param string $identifier
-     * @return bool TRUE if $identifier exists, FALSE otherwise
-     */
-    public function offsetExists($identifier)
-    {
-        return $this->exists($identifier);
-    }
-
-    /**
-     * Get a variable from the context. Throws exception if variable is not found in context.
-     *
-     * @param string $identifier
-     * @return mixed The variable identified by $identifier
-     */
-    public function offsetGet($identifier)
-    {
-        return $this->get($identifier);
-    }
-
-    /**
-     * Gets a variable or NULL if it does not exist
-     *
-     * @param string $variableName name of the variable
-     * @return mixed the stored variable or NULL
-     * @internal
-     */
-    public function getOrNull($variableName)
-    {
-        if ($variableName === '_all') {
-            return $this->variables;
-        }
-
-        return isset($this->variables[$variableName]) ? $this->variables[$variableName] : null;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperInterface.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperInterface.php
deleted file mode 100644
index 8877551eefdc..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperInterface.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-interface ViewHelperInterface
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolver.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolver.php
new file mode 100644
index 000000000000..92eb975f5943
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolver.php
@@ -0,0 +1,71 @@
+<?php
+namespace TYPO3\CMS\Fluid\Core\ViewHelper;
+
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
+
+/**
+ * Class ViewHelperResolver
+ *
+ * Class whose purpose is dedicated to resolving classes which
+ * can be used as ViewHelpers and ExpressionNodes in Fluid.
+ *
+ * This CMS-specific version of the ViewHelperResolver works
+ * almost exactly like the one from Fluid itself, with the main
+ * differences being that this one supports a legacy mode flag
+ * which when toggled on makes the Fluid parser behave exactly
+ * like it did in the legacy CMS Fluid package.
+ *
+ * In addition to modifying the behavior or the parser when
+ * legacy mode is requested, this ViewHelperResolver is also
+ * made capable of "mixing" two different ViewHelper namespaces
+ * to effectively create aliases for the Fluid core ViewHelpers
+ * to be loaded in the TYPO3\CMS\ViewHelpers scope as well.
+ */
+class ViewHelperResolver extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver
+{
+    /**
+     * Custom merged namespace for CMS Fluid adapter;
+     * will look for classes in both namespaces starting
+     * from the bottom.
+     *
+     * @var array
+     */
+    protected $namespaces = array(
+        'f' => array(
+            'TYPO3Fluid\\Fluid\\ViewHelpers',
+            'TYPO3\\CMS\\Fluid\\ViewHelpers'
+        )
+    );
+
+    /**
+     * @param string $viewHelperClassName
+     * @return ViewHelperInterface
+     */
+    public function createViewHelperInstanceFromClassName($viewHelperClassName)
+    {
+        return $this->getObjectManager()->get($viewHelperClassName);
+    }
+
+    /**
+     * @return ObjectManagerInterface
+     */
+    protected function getObjectManager()
+    {
+        return GeneralUtility::makeInstance(ObjectManager::class);
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperVariableContainer.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperVariableContainer.php
deleted file mode 100644
index 4fe01770e240..000000000000
--- a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperVariableContainer.php
+++ /dev/null
@@ -1,150 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @api
- */
-class ViewHelperVariableContainer
-{
-    /**
-     * Two-dimensional object array storing the values. The first dimension is the fully qualified ViewHelper name,
-     * and the second dimension is the identifier for the data the ViewHelper wants to store.
-     *
-     * @var array
-     */
-    protected $objects = array();
-
-    /**
-     * @var \TYPO3\CMS\Fluid\View\AbstractTemplateView
-     */
-    protected $view;
-
-    /**
-     * Add a variable to the Variable Container. Make sure that $viewHelperName is ALWAYS set
-     * to your fully qualified ViewHelper Class Name
-     *
-     * In case the value is already inside, an exception is thrown.
-     *
-     * @param string $viewHelperName The ViewHelper Class name (Fully qualified, like \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper)
-     * @param string $key Key of the data
-     * @param mixed $value The value to store
-     * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException if there was no key with the specified name
-     * @api
-     */
-    public function add($viewHelperName, $key, $value)
-    {
-        if ($this->exists($viewHelperName, $key)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('The key "' . $viewHelperName . '->' . $key . '" was already stored and you cannot override it.', 1243352010);
-        }
-        $this->addOrUpdate($viewHelperName, $key, $value);
-    }
-
-    /**
-     * Add a variable to the Variable Container. Make sure that $viewHelperName is ALWAYS set
-     * to your fully qualified ViewHelper Class Name.
-     * In case the value is already inside, it is silently overridden.
-     *
-     * @param string $viewHelperName The ViewHelper Class name (Fully qualified, like \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper)
-     * @param string $key Key of the data
-     * @param mixed $value The value to store
-     * @return void
-     */
-    public function addOrUpdate($viewHelperName, $key, $value)
-    {
-        if (!isset($this->objects[$viewHelperName])) {
-            $this->objects[$viewHelperName] = array();
-        }
-        $this->objects[$viewHelperName][$key] = $value;
-    }
-
-    /**
-     * Gets a variable which is stored
-     *
-     * @param string $viewHelperName The ViewHelper Class name (Fully qualified, like \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper)
-     * @param string $key Key of the data
-     * @return mixed The object stored
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException if there was no key with the specified name
-     * @api
-     */
-    public function get($viewHelperName, $key)
-    {
-        if (!$this->exists($viewHelperName, $key)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('No value found for key "' . $viewHelperName . '->' . $key . '"', 1243325768);
-        }
-        return $this->objects[$viewHelperName][$key];
-    }
-
-    /**
-     * Determine whether there is a variable stored for the given key
-     *
-     * @param string $viewHelperName The ViewHelper Class name (Fully qualified, like \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper)
-     * @param string $key Key of the data
-     * @return bool TRUE if a value for the given ViewHelperName / Key is stored, FALSE otherwise.
-     * @api
-     */
-    public function exists($viewHelperName, $key)
-    {
-        return isset($this->objects[$viewHelperName]) && array_key_exists($key, $this->objects[$viewHelperName]);
-    }
-
-    /**
-     * Remove a value from the variable container
-     *
-     * @param string $viewHelperName The ViewHelper Class name (Fully qualified, like \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper)
-     * @param string $key Key of the data to remove
-     * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException if there was no key with the specified name
-     * @api
-     */
-    public function remove($viewHelperName, $key)
-    {
-        if (!$this->exists($viewHelperName, $key)) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('No value found for key "' . $viewHelperName . '->' . $key . '", thus the key cannot be removed.', 1243352249);
-        }
-        unset($this->objects[$viewHelperName][$key]);
-    }
-
-    /**
-     * Set the view to pass it to ViewHelpers.
-     *
-     * @param \TYPO3\CMS\Fluid\View\AbstractTemplateView $view View to set
-     * @return void
-     */
-    public function setView(\TYPO3\CMS\Fluid\View\AbstractTemplateView $view)
-    {
-        $this->view = $view;
-    }
-
-    /**
-     * Get the view.
-     *
-     * !!! This is NOT a public API and might still change!!!
-     *
-     * @return \TYPO3\CMS\Fluid\View\AbstractTemplateView The View
-     */
-    public function getView()
-    {
-        return $this->view;
-    }
-
-    /**
-     * Clean up for serializing.
-     *
-     * @return array
-     */
-    public function __sleep()
-    {
-        return array('objects');
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php
index ee0a72d350e8..f38f38509172 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php
@@ -2,28 +2,24 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
+use TYPO3\CMS\Fluid\View\TemplatePaths;
+
 /**
  * This is the base class for all widget controllers.
- * Basically, it is an ActionController, and it additionally
- * has $this->widgetConfiguration set to the Configuration of the current Widget.
+ * It is basically an ActionController and additionally has $this->widgetConfiguration set to the
+ * Configuration of the current Widget.
  *
  * @api
  */
@@ -67,12 +63,19 @@ abstract class AbstractWidgetController extends \TYPO3\CMS\Extbase\Mvc\Controlle
     {
         $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
         $widgetViewHelperClassName = $this->request->getWidgetContext()->getWidgetViewHelperClassName();
-        if (
-            isset($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath'])
-            && $extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath'] !== ''
-            && method_exists($view, 'setTemplateRootPath')
-        ) {
-            $view->setTemplateRootPath(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath']));
+        $templatePaths = new TemplatePaths($this->controllerContext->getRequest()->getControllerExtensionKey());
+        $widgetViewConfiguration = null;
+        $parentConfiguration = $view->getTemplatePaths()->toArray();
+        $rootConfiguration = $templatePaths->toArray();
+        if (!isset($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName])) {
+            $widgetViewConfiguration = array_merge_recursive($parentConfiguration, $rootConfiguration);
+        } else {
+            $widgetViewConfiguration = array_merge_recursive(
+                (array) $rootConfiguration,
+                (array) $parentConfiguration,
+                (array) $extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]
+            );
         }
+        $view->getTemplatePaths()->fillFromConfigurationArray($widgetViewConfiguration);
     }
 }
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
index 3d39459b4955..e0b144f5dfaa 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
@@ -1,29 +1,26 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
+
 /**
  * @api
  */
-abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface
+abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
      * The Controller associated to this widget.
@@ -59,6 +56,11 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
      */
     protected $extensionService;
 
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
+
     /**
      * @var \TYPO3\CMS\Fluid\Core\Widget\WidgetContext
      */
@@ -106,8 +108,8 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
         $this->widgetContext->setWidgetConfiguration($this->getWidgetConfiguration());
         $this->initializeWidgetIdentifier();
         $this->widgetContext->setControllerObjectName(get_class($this->controller));
-        $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
-        $pluginName = $this->controllerContext->getRequest()->getPluginName();
+        $extensionName = $this->renderingContext->getControllerContext()->getRequest()->getControllerExtensionName();
+        $pluginName = $this->renderingContext->getControllerContext()->getRequest()->getPluginName();
         $this->widgetContext->setParentExtensionName($extensionName);
         $this->widgetContext->setParentPluginName($pluginName);
         $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
@@ -150,15 +152,17 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
      * via Dependency Injection.
      *
      * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface the response of this request.
+     * @throws \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException
      * @api
      */
     protected function initiateSubRequest()
     {
-        if (!$this->controller instanceof \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController) {
-            if (isset($this->controller)) {
-                throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException('initiateSubRequest() can not be called if there is no valid controller extending TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController. Got "' . get_class($this->controller) . '" in class "' . get_class($this) . '".', 1289422564);
-            }
-            throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException('initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) . '".', 1284401632);
+        if (!isset($this->controller) || !$this->controller instanceof \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController) {
+            throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException(
+                'initiateSubRequest() can not be called if there is no valid controller extending ' .
+                'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController' .
+                ' Got "' . ($this->controller ? get_class($this->controller) : gettype($this->controller)) .
+                '" in class "' . get_class($this) . '".', 1289422564);
         }
         $subRequest = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
         $subRequest->setWidgetContext($this->widgetContext);
@@ -176,7 +180,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
      */
     private function passArgumentsToSubRequest(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest $subRequest)
     {
-        $arguments = $this->controllerContext->getRequest()->getArguments();
+        $arguments = $this->renderingContext->getControllerContext()->getRequest()->getArguments();
         $widgetIdentifier = $this->widgetContext->getWidgetIdentifier();
         if (isset($arguments[$widgetIdentifier])) {
             if (isset($arguments[$widgetIdentifier]['action'])) {
@@ -197,13 +201,22 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
      */
     private function initializeWidgetIdentifier()
     {
-        if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber')) {
-            $widgetCounter = 0;
-        } else {
-            $widgetCounter = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber');
-        }
+        $widgetCounter = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber', 0);
         $widgetIdentifier = '@widget_' . $widgetCounter;
         $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber', $widgetCounter + 1);
         $this->widgetContext->setWidgetIdentifier($widgetIdentifier);
     }
+
+    /**
+     * @param string $argumentsName
+     * @param string $closureName
+     * @param string $initializationPhpCode
+     * @param ViewHelperNode $node
+     * @param TemplateCompiler $compiler
+     */
+    public function compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
+    {
+        $compiler->disable();
+        return '\'\'';
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php b/typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php
index 5b57351b59dc..7dadd4ca10a3 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * This object stores the WidgetContext for the currently active widgets
  * of the current user, to make sure the WidgetContext is available in
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php b/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php
index e343c753330f..501f7207d03e 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * This is the bootstrap for Ajax Widget responses
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Exception.php b/typo3/sysext/fluid/Classes/Core/Widget/Exception.php
index c458bc11dec7..599fb46c828d 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Exception.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Exception.php
@@ -1,30 +1,24 @@
 <?php
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A Fluid Widget exception.
  *
  * @api
  */
-class Exception extends \TYPO3\CMS\Fluid\Core\Exception
+class Exception extends \TYPO3Fluid\Fluid\Core\Exception
 {
 }
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Exception/MissingControllerException.php b/typo3/sysext/fluid/Classes/Core/Widget/Exception/MissingControllerException.php
index c70ee1749567..179c324a4d59 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Exception/MissingControllerException.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Exception/MissingControllerException.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget\Exception;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * An exception if the controller is missing.
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Exception/RenderingContextNotFoundException.php b/typo3/sysext/fluid/Classes/Core/Widget/Exception/RenderingContextNotFoundException.php
index 010e54f72dbb..67df3bde0c9d 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Exception/RenderingContextNotFoundException.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Exception/RenderingContextNotFoundException.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget\Exception;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * An exception if no widget context could be found inside the AjaxWidgetContextHolder.
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetContextNotFoundException.php b/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetContextNotFoundException.php
index 531f8880142f..3fa1e561af9b 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetContextNotFoundException.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetContextNotFoundException.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget\Exception;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * An exception if no widget context could be found inside the AjaxWidgetContextHolder.
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetRequestNotFoundException.php b/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetRequestNotFoundException.php
index 01eff61c51be..bc3a1d09718c 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetRequestNotFoundException.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/Exception/WidgetRequestNotFoundException.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget\Exception;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * An exception if no widget Request could be found inside <f:renderChildren>.
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php b/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php
index 6c9577d16dc5..d60a3d242e52 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * The WidgetContext stores all information a widget needs to know about the
  * environment.
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequest.php b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequest.php
index 39b21ab0d7b3..a57767c749a1 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequest.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequest.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * Represents a widget request.
  */
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php
index da79838ddc85..9f44885370f7 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php
@@ -2,24 +2,20 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Builds the WidgetRequest if an AJAX widget is called.
  */
@@ -47,16 +43,15 @@ class WidgetRequestBuilder extends \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder
     public function build()
     {
         $request = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
-        $request->setRequestURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
-        $request->setBaseURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
+        $request->setRequestURI(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
+        $request->setBaseURI(GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
         $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null);
         if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
-            $request->setArguments(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST());
+            $request->setArguments(GeneralUtility::_POST());
         } else {
-            $request->setArguments(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET());
+            $request->setArguments(GeneralUtility::_GET());
         }
-        $rawGetArguments = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
-        // @todo rename to @action, to be consistent with normal naming?
+        $rawGetArguments = GeneralUtility::_GET();
         if (isset($rawGetArguments['action'])) {
             $request->setControllerActionName($rawGetArguments['action']);
         }
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
index 76730b5c70d6..56783b66bd2e 100644
--- a/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
+++ b/typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\Core\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * Widget request handler, which handles the request if
  * f3-fluid-widget-id is found.
@@ -54,9 +48,6 @@ class WidgetRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHan
     public function handleRequest()
     {
         $request = $this->requestBuilder->build();
-        if (isset($this->cObj->data) && is_array($this->cObj->data)) {
-            $request->setContentObjectData($this->cObj->data);
-        }
         $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
         $this->dispatcher->dispatch($request, $response);
         return $response;
diff --git a/typo3/sysext/fluid/Classes/Exception.php b/typo3/sysext/fluid/Classes/Exception.php
deleted file mode 100644
index cc30ad797758..000000000000
--- a/typo3/sysext/fluid/Classes/Exception.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid;
-
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-class Exception extends \Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/Fluid.php b/typo3/sysext/fluid/Classes/Fluid.php
deleted file mode 100644
index b475ee281771..000000000000
--- a/typo3/sysext/fluid/Classes/Fluid.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid;
-
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-class Fluid
-{
-    const LEGACY_NAMESPACE_SEPARATOR = '_';
-    const NAMESPACE_SEPARATOR = '\\';
-
-    /**
-     * Can be used to enable the verbose mode of Fluid.
-     *
-     * This enables the following things:
-     * - ViewHelper argument descriptions are being parsed from the PHPDoc
-     *
-     * This is NO PUBLIC API and the way this mode is enabled might change without
-     * notice in the future.
-     *
-     * @var bool
-     */
-    public static $debugMode = false;
-}
diff --git a/typo3/sysext/fluid/Classes/Service/AbstractGenerator.php b/typo3/sysext/fluid/Classes/Service/AbstractGenerator.php
deleted file mode 100644
index 170185c1dd90..000000000000
--- a/typo3/sysext/fluid/Classes/Service/AbstractGenerator.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Service;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Common base class for XML generators.
- */
-abstract class AbstractGenerator
-{
-    /**
-     * The reflection class for AbstractViewHelper. Is needed quite often, that's why we use a pre-initialized one.
-     *
-     * @var \TYPO3\CMS\Extbase\Reflection\ClassReflection
-     */
-    protected $abstractViewHelperReflectionClass;
-
-    /**
-     * The doc comment parser.
-     *
-     * @var \TYPO3\CMS\Extbase\Reflection\DocCommentParser
-     * @inject
-     */
-    protected $docCommentParser;
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-     * @inject
-     */
-    protected $reflectionService;
-
-    /**
-     * Constructor. Sets $this->abstractViewHelperReflectionClass
-     *
-     */
-    public function __construct()
-    {
-        \TYPO3\CMS\Fluid\Fluid::$debugMode = true; // We want ViewHelper argument documentation
-        $this->abstractViewHelperReflectionClass = new \TYPO3\CMS\Extbase\Reflection\ClassReflection(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-    }
-
-    /**
-     * Get all class names inside this namespace and return them as array.
-     *
-     * @param string $namespace
-     * @return array Array of all class names inside a given namespace.
-     */
-    protected function getClassNamesInNamespace($namespace)
-    {
-        $affectedViewHelperClassNames = array();
-
-        $allViewHelperClassNames = $this->reflectionService->getAllSubClassNamesForClass(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-        foreach ($allViewHelperClassNames as $viewHelperClassName) {
-            if ($this->reflectionService->isClassAbstract($viewHelperClassName)) {
-                continue;
-            }
-            if (strncmp($namespace, $viewHelperClassName, strlen($namespace)) === 0) {
-                $affectedViewHelperClassNames[] = $viewHelperClassName;
-            }
-        }
-        sort($affectedViewHelperClassNames);
-        return $affectedViewHelperClassNames;
-    }
-
-    /**
-     * Get a tag name for a given ViewHelper class.
-     * Example: For the View Helper TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper, and the
-     * namespace prefix TYPO3\CMS\Fluid\ViewHelpers\, this method returns "form.select".
-     *
-     * @param string $className Class name
-     * @param string $namespace Base namespace to use
-     * @return string Tag name
-     */
-    protected function getTagNameForClass($className, $namespace)
-    {
-        /// Strip namespace from the beginning and "ViewHelper" from the end of the class name
-        $strippedClassName = substr($className, strlen($namespace), -10);
-        $classNameParts = explode(\TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR, $strippedClassName);
-        return implode(
-            '.',
-            array_map(
-                function ($element) {
-                    return lcfirst($element);
-                },
-                $classNameParts
-            )
-        );
-    }
-
-    /**
-     * Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.
-     *
-     * @param \SimpleXMLElement $parentXmlNode Parent XML Node to add the child to
-     * @param string $childNodeName Name of the child node
-     * @param string $childNodeValue Value of the child node. Will be placed inside CDATA.
-     * @return \SimpleXMLElement the new element
-     */
-    protected function addChildWithCData(\SimpleXMLElement $parentXmlNode, $childNodeName, $childNodeValue)
-    {
-        $parentDomNode = dom_import_simplexml($parentXmlNode);
-        $domDocument = new \DOMDocument();
-
-        $childNode = $domDocument->appendChild($domDocument->createElement($childNodeName));
-        $childNode->appendChild($domDocument->createCDATASection($childNodeValue));
-        $childNodeTarget = $parentDomNode->ownerDocument->importNode($childNode, true);
-        $parentDomNode->appendChild($childNodeTarget);
-        return simplexml_import_dom($childNodeTarget);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/Service/DocbookGenerator.php b/typo3/sysext/fluid/Classes/Service/DocbookGenerator.php
deleted file mode 100644
index 0d6a715c0d0d..000000000000
--- a/typo3/sysext/fluid/Classes/Service/DocbookGenerator.php
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Service;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperInterface;
-
-/**
- * XML Schema (XSD) Generator. Will generate an XML schema which can be used for autocompletion
- * in schema-aware editors like Eclipse XML editor.
- */
-class DocbookGenerator extends \TYPO3\CMS\Fluid\Service\AbstractGenerator
-{
-    /**
-     * Generate the XML Schema definition for a given namespace.
-     *
-     * @param string $namespace Namespace identifier to generate the XSD for, without leading Backslash.
-     * @return string XML Schema definition
-     */
-    public function generateDocbook($namespace)
-    {
-        if (substr($namespace, -1) !== \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR) {
-            $namespace .= \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR;
-        }
-        $classNames = $this->getClassNamesInNamespace($namespace);
-        $xmlRootNode = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?>
-<section version="5.0" xmlns="http://docbook.org/ns/docbook"
-         xml:id="fluid.usermanual.standardviewhelpers"
-         xmlns:xl="http://www.w3.org/1999/xlink"
-         xmlns:xi="http://www.w3.org/2001/XInclude"
-         xmlns:xhtml="http://www.w3.org/1999/xhtml"
-         xmlns:svg="http://www.w3.org/2000/svg"
-         xmlns:ns="http://docbook.org/ns/docbook"
-         xmlns:mathml="http://www.w3.org/1998/Math/MathML">
-    <title>Standard View Helper Library</title>
-
-    <para>Should be autogenerated from the tags.</para>
-</section>');
-        foreach ($classNames as $className) {
-            $this->generateXmlForClassName($className, $namespace, $xmlRootNode);
-        }
-        return $xmlRootNode->asXML();
-    }
-
-    /**
-     * Generate the XML Schema for a given class name.
-     *
-     * @param string $className Class name to generate the schema for.
-     * @param string $namespace Namespace prefix. Used to split off the first parts of the class name.
-     * @param \SimpleXMLElement $xmlRootNode XML root node where the xsd:element is appended.
-     * @return void
-     */
-    protected function generateXmlForClassName($className, $namespace, \SimpleXMLElement $xmlRootNode)
-    {
-        $reflectionClass = new \TYPO3\CMS\Extbase\Reflection\ClassReflection($className);
-        if (!$reflectionClass->isSubclassOf($this->abstractViewHelperReflectionClass)) {
-            return;
-        }
-        $tagName = $this->getTagNameForClass($className, $namespace);
-        $docbookSection = $xmlRootNode->addChild('section');
-        $docbookSection->addChild('title', $tagName);
-        $this->docCommentParser->parseDocComment($reflectionClass->getDocComment());
-        $this->addDocumentation($this->docCommentParser->getDescription(), $docbookSection);
-        $argumentsSection = $docbookSection->addChild('section');
-        $argumentsSection->addChild('title', 'Arguments');
-        $this->addArguments($className, $argumentsSection);
-        return $docbookSection;
-    }
-
-    /**
-     * Add attribute descriptions to a given tag.
-     * Initializes the view helper and its arguments, and then reads out the list of arguments.
-     *
-     * @param string $className Class name where to add the attribute descriptions
-     * @param \SimpleXMLElement $docbookSection DocBook section to add the attributes to.
-     * @return void
-     */
-    protected function addArguments($className, \SimpleXMLElement $docbookSection)
-    {
-        $viewHelper = $this->instanciateViewHelper($className);
-        $argumentDefinitions = $viewHelper->prepareArguments();
-        if (count($argumentDefinitions) === 0) {
-            $docbookSection->addChild('para', 'No arguments defined.');
-            return;
-        }
-        $argumentsTable = $docbookSection->addChild('table');
-        $argumentsTable->addChild('title', 'Arguments');
-        $tgroup = $argumentsTable->addChild('tgroup');
-        $tgroup['cols'] = 4;
-        $this->addArgumentTableRow($tgroup->addChild('thead'), 'Name', 'Type', 'Required', 'Description', 'Default');
-        $tbody = $tgroup->addChild('tbody');
-        foreach ($argumentDefinitions as $argumentDefinition) {
-            $this->addArgumentTableRow($tbody, $argumentDefinition->getName(), $argumentDefinition->getType(), $argumentDefinition->isRequired() ? 'yes' : 'no', $argumentDefinition->getDescription(), $argumentDefinition->getDefaultValue());
-        }
-    }
-
-    /**
-     * Instantiate a view helper.
-     *
-     * @param string $className
-     * @return ViewHelperInterface
-     */
-    protected function instanciateViewHelper($className)
-    {
-        return $this->objectManager->get($className);
-    }
-
-    /**
-     * @param \SimpleXMLElement $parent
-     * @param string $name
-     * @param string $type
-     * @param bool $required
-     * @param string $description
-     * @param string $default
-     * @return void
-     */
-    private function addArgumentTableRow(\SimpleXMLElement $parent, $name, $type, $required, $description, $default)
-    {
-        $row = $parent->addChild('row');
-        $row->addChild('entry', $name);
-        $row->addChild('entry', $type);
-        $row->addChild('entry', $required);
-        $row->addChild('entry', $description);
-        $row->addChild('entry', (string)$default);
-    }
-
-    /**
-     * Add documentation XSD to a given XML node
-     *
-     * As Eclipse renders newlines only on new <xsd:documentation> tags, we wrap every line in a new
-     * <xsd:documentation> tag.
-     * Furthermore, eclipse strips out tags - the only way to prevent this is to have every line wrapped in a
-     * CDATA block AND to replace the < and > with their XML entities. (This is IMHO not XML conformant).
-     *
-     * @param string $documentation Documentation string to add.
-     * @param \SimpleXMLElement $docbookSection Node to add the documentation to
-     * @return void
-     */
-    protected function addDocumentation($documentation, \SimpleXMLElement $docbookSection)
-    {
-        $splitRegex = '/^\\s*(=[^=]+=)$/m';
-        $regex = '/^\\s*(=([^=]+)=)$/m';
-        $matches = preg_split($splitRegex, $documentation, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
-        $currentSection = $docbookSection;
-        foreach ($matches as $singleMatch) {
-            if (preg_match($regex, $singleMatch, $tmp)) {
-                $currentSection = $docbookSection->addChild('section');
-                $currentSection->addChild('title', trim($tmp[2]));
-            } else {
-                $this->addText(trim($singleMatch), $currentSection);
-            }
-        }
-    }
-
-    /**
-     * @param string $text
-     * @param \SimpleXMLElement $parentElement
-     */
-    protected function addText($text, \SimpleXMLElement $parentElement)
-    {
-        $splitRegex = '/
-		(<code(?:.*?)>
-			(?:.*?)
-		<\\/code>)/xs';
-        $regex = '/
-		<code(.*?)>
-			(.*?)
-		<\\/code>/xs';
-        $matches = preg_split($splitRegex, $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
-        foreach ($matches as $singleMatch) {
-            if (preg_match($regex, $singleMatch, $tmp)) {
-                preg_match('/title="([^"]+)"/', $tmp[1], $titleMatch);
-                $example = $parentElement->addChild('example');
-                if (count($titleMatch)) {
-                    $example->addChild('title', trim($titleMatch[1]));
-                } else {
-                    $example->addChild('title', 'Example');
-                }
-                $this->addChildWithCData($example, 'programlisting', trim($tmp[2]));
-            } else {
-                $textParts = explode("\n", $singleMatch);
-                foreach ($textParts as $text) {
-                    if (trim($text) === '') {
-                        continue;
-                    }
-                    $this->addChildWithCData($parentElement, 'para', trim($text));
-                }
-            }
-        }
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
index caddc813b34d..aae804232d9f 100644
--- a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
+++ b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
@@ -1,457 +1,56 @@
 <?php
 namespace TYPO3\CMS\Fluid\View;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+use TYPO3Fluid\Fluid\View\TemplateView;
 
 /**
  * Abstract Fluid Template View.
  *
  * Contains the fundamental methods which any Fluid based template view needs.
  */
-abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewInterface
+abstract class AbstractTemplateView extends TemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewInterface
 {
-    /**
-     * Constants defining possible rendering types
-     */
-    const RENDERING_TEMPLATE = 1;
-    const RENDERING_PARTIAL = 2;
-    const RENDERING_LAYOUT = 3;
-
     /**
      * @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
      */
     protected $controllerContext;
 
     /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
-     */
-    protected $objectManager;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\TemplateParser
-     * @inject
-     */
-    protected $templateParser;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler
-     */
-    protected $templateCompiler;
-
-    /**
-     * The initial rendering context for this template view.
-     * Due to the rendering stack, another rendering context might be active
-     * at certain points while rendering the template.
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
-     */
-    protected $baseRenderingContext;
-
-    /**
-     * Stack containing the current rendering type, the current rendering context, and the current parsed template
-     * Do not manipulate directly, instead use the methods"getCurrent*()", "startRendering(...)" and "stopRendering()"
+     * Initializes this view.
      *
-     * @var array
-     */
-    protected $renderingStack = array();
-
-    /**
-     * Partial Name -> Partial Identifier cache.
-     * This is a performance optimization, effective when rendering a
-     * single partial many times.
-     *
-     * @var array
-     */
-    protected $partialIdentifierCache = array();
-
-    /**
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return void
-     */
-    public function injectTemplateCompiler(\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
-    {
-        $this->templateCompiler = $templateCompiler;
-        $this->templateCompiler->setTemplateCache(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('fluid_template'));
-    }
-
-    /**
-     * Injects a fresh rendering context
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return void
-     */
-    public function setRenderingContext(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $this->baseRenderingContext = $renderingContext;
-        $this->baseRenderingContext->getViewHelperVariableContainer()->setView($this);
-        $this->controllerContext = $renderingContext->getControllerContext();
-    }
-
-    /**
-     * Sets the current controller context
-     *
-     * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext Controller context which is available inside the view
      * @return void
      * @api
      */
-    public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
-    {
-        $this->controllerContext = $controllerContext;
-    }
-
     public function initializeView()
     {
     }
-    // Here, the backporter can insert the initializeView method, which is needed for Fluid v4.
-
-    /**
-     * Assign a value to the variable container.
-     *
-     * @param string $key The key of a view variable to set
-     * @param mixed $value The value of the view variable
-     * @return \TYPO3\CMS\Fluid\View\AbstractTemplateView the instance of this view to allow chaining
-     * @api
-     */
-    public function assign($key, $value)
-    {
-        $templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
-        if ($templateVariableContainer->exists($key)) {
-            $templateVariableContainer->remove($key);
-        }
-        $templateVariableContainer->add($key, $value);
-        return $this;
-    }
-
-    /**
-     * Assigns multiple values to the JSON output.
-     * However, only the key "value" is accepted.
-     *
-     * @param array $values Keys and values - only a value with key "value" is considered
-     * @return \TYPO3\CMS\Fluid\View\AbstractTemplateView the instance of this view to allow chaining
-     * @api
-     */
-    public function assignMultiple(array $values)
-    {
-        $templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
-        foreach ($values as $key => $value) {
-            if ($templateVariableContainer->exists($key)) {
-                $templateVariableContainer->remove($key);
-            }
-            $templateVariableContainer->add($key, $value);
-        }
-        return $this;
-    }
-
-    /**
-     * Loads the template source and render the template.
-     * If "layoutName" is set in a PostParseFacet callback, it will render the file with the given layout.
-     *
-     * @param string $actionName If set, the view of the specified action will be rendered instead. Default is the action specified in the Request object
-     * @return string Rendered Template
-     * @api
-     */
-    public function render($actionName = null)
-    {
-        $this->baseRenderingContext->setControllerContext($this->controllerContext);
-        $this->templateParser->setConfiguration($this->buildParserConfiguration());
-
-        $templateIdentifier = $this->getTemplateIdentifier($actionName);
-        if ($this->templateCompiler->has($templateIdentifier)) {
-            $parsedTemplate = $this->templateCompiler->get($templateIdentifier);
-        } else {
-            $parsedTemplate = $this->templateParser->parse($this->getTemplateSource($actionName));
-            if ($parsedTemplate->isCompilable()) {
-                $this->templateCompiler->store($templateIdentifier, $parsedTemplate);
-            }
-        }
-
-        if ($parsedTemplate->hasLayout()) {
-            $layoutName = $parsedTemplate->getLayoutName($this->baseRenderingContext);
-            $layoutIdentifier = $this->getLayoutIdentifier($layoutName);
-            if ($this->templateCompiler->has($layoutIdentifier)) {
-                $parsedLayout = $this->templateCompiler->get($layoutIdentifier);
-            } else {
-                $parsedLayout = $this->templateParser->parse($this->getLayoutSource($layoutName));
-                if ($parsedLayout->isCompilable()) {
-                    $this->templateCompiler->store($layoutIdentifier, $parsedLayout);
-                }
-            }
-            $this->startRendering(self::RENDERING_LAYOUT, $parsedTemplate, $this->baseRenderingContext);
-            $output = $parsedLayout->render($this->baseRenderingContext);
-            $this->stopRendering();
-        } else {
-            $this->startRendering(self::RENDERING_TEMPLATE, $parsedTemplate, $this->baseRenderingContext);
-            $output = $parsedTemplate->render($this->baseRenderingContext);
-            $this->stopRendering();
-        }
-
-        return $output;
-    }
 
     /**
-     * Renders a given section.
-     *
-     * @param string $sectionName Name of section to render
-     * @param array $variables The variables to use
-     * @param bool $ignoreUnknown Ignore an unknown section and just return an empty string
-     * @return string rendered template for the section
-     * @throws \TYPO3\CMS\Fluid\View\Exception\InvalidSectionException
+     * @param RenderingContextInterface $context
      */
-    public function renderSection($sectionName, array $variables, $ignoreUnknown = false)
+    public function __construct(RenderingContextInterface $context = null)
     {
-        $renderingContext = $this->getCurrentRenderingContext();
-        if ($this->getCurrentRenderingType() === self::RENDERING_LAYOUT) {
-            // in case we render a layout right now, we will render a section inside a TEMPLATE.
-            $renderingTypeOnNextLevel = self::RENDERING_TEMPLATE;
-        } else {
-            $variableContainer = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class, $variables);
-            $renderingContext = clone $renderingContext;
-            $renderingContext->injectTemplateVariableContainer($variableContainer);
-            $renderingTypeOnNextLevel = $this->getCurrentRenderingType();
+        if (!$context) {
+            $context = GeneralUtility::makeInstance(ObjectManager::class)->get(RenderingContext::class, $this);
         }
-
-        $parsedTemplate = $this->getCurrentParsedTemplate();
-
-        if ($parsedTemplate->isCompiled()) {
-            $methodNameOfSection = 'section_' . sha1($sectionName);
-            if ($ignoreUnknown && !method_exists($parsedTemplate, $methodNameOfSection)) {
-                return '';
-            }
-            $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext);
-            $output = $parsedTemplate->{$methodNameOfSection}($renderingContext);
-            $this->stopRendering();
-        } else {
-            $sections = $parsedTemplate->getVariableContainer()->get('sections');
-            if (!array_key_exists($sectionName, $sections)) {
-                $controllerObjectName = $this->controllerContext->getRequest()->getControllerObjectName();
-                if ($ignoreUnknown) {
-                    return '';
-                } else {
-                    throw new \TYPO3\CMS\Fluid\View\Exception\InvalidSectionException(sprintf('Could not render unknown section "%s" in %s used by %s.', $sectionName, get_class($this), $controllerObjectName), 1227108982);
-                }
-            }
-            $section = $sections[$sectionName];
-
-            $renderingContext->getViewHelperVariableContainer()->add(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection', 'TRUE');
-
-            $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext);
-            $output = $section->evaluate($renderingContext);
-            $this->stopRendering();
-        }
-
-        return $output;
-    }
-
-    /**
-     * Renders a partial.
-     *
-     * @param string $partialName
-     * @param string $sectionName
-     * @param array $variables
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer the View Helper Variable container to use.
-     * @return string
-     */
-    public function renderPartial($partialName, $sectionName, array $variables)
-    {
-        $partialNameWithFormat = $partialName . '.' . $this->controllerContext->getRequest()->getFormat();
-        if (!isset($this->partialIdentifierCache[$partialNameWithFormat])) {
-            $this->partialIdentifierCache[$partialNameWithFormat] = $this->getPartialIdentifier($partialName);
-        }
-        $partialIdentifier = $this->partialIdentifierCache[$partialNameWithFormat];
-
-        if ($this->templateCompiler->has($partialIdentifier)) {
-            $parsedPartial = $this->templateCompiler->get($partialIdentifier);
-        } else {
-            $parsedPartial = $this->templateParser->parse($this->getPartialSource($partialName));
-            if ($parsedPartial->isCompilable()) {
-                $this->templateCompiler->store($partialIdentifier, $parsedPartial);
-            }
-        }
-
-        $variableContainer = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class, $variables);
-        $renderingContext = clone $this->getCurrentRenderingContext();
-        $renderingContext->injectTemplateVariableContainer($variableContainer);
-
-        $this->startRendering(self::RENDERING_PARTIAL, $parsedPartial, $renderingContext);
-        if ($sectionName !== null) {
-            $output = $this->renderSection($sectionName, $variables);
-        } else {
-            $output = $parsedPartial->render($renderingContext);
-        }
-        $this->stopRendering();
-
-        return $output;
-    }
-
-    /**
-     * Ensures the given templatePath gets the file name in UpperCamelCase
-     *
-     * @param string $templatePath A file name or a relative path
-     * @return string
-     */
-    protected function ucFileNameInPath($templatePath)
-    {
-        if (strpos($templatePath, '/') > 0) {
-            $pathParts = explode('/', $templatePath);
-            $index = count($pathParts) - 1;
-            $pathParts[$index] = ucfirst($pathParts[$index]);
-
-            $upperCasedTemplateName = implode('/', $pathParts);
-        } else {
-            $upperCasedTemplateName = ucfirst($templatePath);
-        }
-        return $upperCasedTemplateName;
-    }
-
-    /**
-     * Wrapper method for is_file function for testing reasons
-     *
-     * @param string $filePath
-     * @return bool
-     */
-    protected function testFileExistence($filePath)
-    {
-        return is_file($filePath);
-    }
-
-    /**
-     * Returns a unique identifier for the resolved template file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $actionName Name of the action. If NULL, will be taken from request.
-     * @return string template identifier
-     */
-    abstract protected function getTemplateIdentifier($actionName = null);
-
-    /**
-     * Resolve the template path and filename for the given action. If $actionName
-     * is NULL, looks into the current request.
-     *
-     * @param string $actionName Name of the action. If NULL, will be taken from request.
-     * @return string Full path to template
-     * @throws \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException in case the template was not found
-     */
-    abstract protected function getTemplateSource($actionName = null);
-
-    /**
-     * Returns a unique identifier for the resolved layout file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $layoutName The name of the layout
-     * @return string layout identifier
-     */
-    abstract protected function getLayoutIdentifier($layoutName = 'Default');
-
-    /**
-     * Resolve the path and file name of the layout file, based on
-     * $this->layoutPathAndFilename and $this->layoutPathAndFilenamePattern.
-     *
-     * In case a layout has already been set with setLayoutPathAndFilename(),
-     * this method returns that path, otherwise a path and filename will be
-     * resolved using the layoutPathAndFilenamePattern.
-     *
-     * @param string $layoutName Name of the layout to use. If none given, use "Default"
-     * @return string Path and filename of layout file
-     * @throws \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    abstract protected function getLayoutSource($layoutName = 'Default');
-
-    /**
-     * Returns a unique identifier for the resolved partial file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $partialName The name of the partial
-     * @return string partial identifier
-     */
-    abstract protected function getPartialIdentifier($partialName);
-
-    /**
-     * Figures out which partial to use.
-     *
-     * @param string $partialName The name of the partial
-     * @return string the full path which should be used. The path definitely exists.
-     * @throws \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    abstract protected function getPartialSource($partialName);
-
-    /**
-     * Build parser configuration
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\Configuration
-     */
-    protected function buildParserConfiguration()
-    {
-        $parserConfiguration = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\Configuration::class);
-        if ($this->controllerContext->getRequest()->getFormat() === 'html') {
-            $parserConfiguration->addInterceptor($this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\Interceptor\Escape::class));
-        }
-        return $parserConfiguration;
-    }
-
-    /**
-     * Start a new nested rendering. Pushes the given information onto the $renderingStack.
-     *
-     * @param int $type one of the RENDERING_* constants
-     * @param \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface $parsedTemplate
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return void
-     */
-    protected function startRendering($type, \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface $parsedTemplate, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        array_push($this->renderingStack, array('type' => $type, 'parsedTemplate' => $parsedTemplate, 'renderingContext' => $renderingContext));
-    }
-
-    /**
-     * Stops the current rendering. Removes one element from the $renderingStack. Make sure to always call this
-     * method pair-wise with startRendering().
-     *
-     * @return void
-     */
-    protected function stopRendering()
-    {
-        array_pop($this->renderingStack);
-    }
-
-    /**
-     * Get the current rendering type.
-     *
-     * @return int one of RENDERING_* constants
-     */
-    protected function getCurrentRenderingType()
-    {
-        $currentRendering = end($this->renderingStack);
-        return $currentRendering['type'];
-    }
-
-    /**
-     * Get the parsed template which is currently being rendered.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface
-     */
-    protected function getCurrentParsedTemplate()
-    {
-        $currentRendering = end($this->renderingStack);
-        return $currentRendering['parsedTemplate'];
-    }
-
-    /**
-     * Get the rendering context which is currently used.
-     *
-     * @return \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
-     */
-    protected function getCurrentRenderingContext()
-    {
-        $currentRendering = end($this->renderingStack);
-        return $currentRendering['renderingContext'];
+        $this->setRenderingContext($context);
     }
 
     /**
@@ -468,4 +67,18 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
     {
         return true;
     }
+
+    /**
+     * Sets the current controller context
+     *
+     * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext
+     * @return void
+     */
+    public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
+    {
+        $request = $controllerContext->getRequest();
+        $this->controllerContext = $controllerContext;
+        $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey());
+        $this->baseRenderingContext->setControllerContext($controllerContext);
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/View/Exception.php b/typo3/sysext/fluid/Classes/View/Exception.php
deleted file mode 100644
index 82616a0f6c2d..000000000000
--- a/typo3/sysext/fluid/Classes/View/Exception.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\View;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * A generic Fluid View exception.
- *
- * @api
- */
-class Exception extends \TYPO3\CMS\Fluid\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/View/Exception/InvalidSectionException.php b/typo3/sysext/fluid/Classes/View/Exception/InvalidSectionException.php
deleted file mode 100644
index e79857b3d4a0..000000000000
--- a/typo3/sysext/fluid/Classes/View/Exception/InvalidSectionException.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\View\Exception;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * An "Invalid Section" exception
- *
- * @api
- */
-class InvalidSectionException extends \TYPO3\CMS\Fluid\View\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php b/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php
deleted file mode 100644
index f6b74b02af5a..000000000000
--- a/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\View\Exception;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * An "Invalid Template Resource" exception
- *
- * @api
- */
-class InvalidTemplateResourceException extends \TYPO3\CMS\Fluid\View\Exception
-{
-}
diff --git a/typo3/sysext/fluid/Classes/View/StandaloneView.php b/typo3/sysext/fluid/Classes/View/StandaloneView.php
index 10cea29a6698..fb88a3308b32 100644
--- a/typo3/sysext/fluid/Classes/View/StandaloneView.php
+++ b/typo3/sysext/fluid/Classes/View/StandaloneView.php
@@ -1,35 +1,25 @@
 <?php
 namespace TYPO3\CMS\Fluid\View;
 
-/**                                                                       *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-use TYPO3\CMS\Core\Cache\CacheManager;
+/*
+ * 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!
+ */
+
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
 use TYPO3\CMS\Extbase\Mvc\Web\Request as WebRequest;
 use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Extbase\Utility\ArrayUtility;
-use TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler;
-use TYPO3\CMS\Fluid\Core\Parser\TemplateParser;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -42,41 +32,6 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
  */
 class StandaloneView extends AbstractTemplateView
 {
-    /**
-     * Source code of the Fluid template
-     *
-     * @var string
-     */
-    protected $templateSource = null;
-
-    /**
-     * absolute path of the Fluid template
-     *
-     * @var string
-     */
-    protected $templatePathAndFilename = null;
-
-    /**
-     * Path(s) to the template root
-     *
-     * @var string[]
-     */
-    protected $templateRootPaths = null;
-
-    /**
-     * Path(s) to the partial root
-     *
-     * @var string[]
-     */
-    protected $partialRootPaths = null;
-
-    /**
-     * Path(s) to the layout root
-     *
-     * @var string[]
-     */
-    protected $layoutRootPaths = null;
-
     /**
      * Constructor
      *
@@ -87,6 +42,7 @@ class StandaloneView extends AbstractTemplateView
     public function __construct(ContentObjectRenderer $contentObject = null)
     {
         $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
+
         /** @var ConfigurationManagerInterface $configurationManager */
         $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);
         if ($contentObject === null) {
@@ -94,8 +50,7 @@ class StandaloneView extends AbstractTemplateView
             $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
         }
         $configurationManager->setContentObject($contentObject);
-        $this->templateParser = $this->objectManager->get(TemplateParser::class);
-        $this->setRenderingContext($this->objectManager->get(RenderingContext::class));
+
         /** @var WebRequest $request */
         $request = $this->objectManager->get(WebRequest::class);
         $request->setRequestURI(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
@@ -107,10 +62,17 @@ class StandaloneView extends AbstractTemplateView
         $controllerContext = $this->objectManager->get(ControllerContext::class);
         $controllerContext->setRequest($request);
         $controllerContext->setUriBuilder($uriBuilder);
-        $this->setControllerContext($controllerContext);
-        $this->templateCompiler = $this->objectManager->get(TemplateCompiler::class);
-        // singleton
-        $this->templateCompiler->setTemplateCache(GeneralUtility::makeInstance(CacheManager::class)->getCache('fluid_template'));
+        $renderingContext = $this->objectManager->get(RenderingContext::class, $this);
+        $renderingContext->setControllerContext($controllerContext);
+        $this->setRenderingContext($renderingContext);
+    }
+
+    /**
+     * @param string $templateName
+     */
+    public function setTemplate($templateName)
+    {
+        $this->baseRenderingContext->setControllerAction($templateName);
     }
 
     /**
@@ -122,7 +84,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setFormat($format)
     {
-        $this->getRequest()->setFormat($format);
+        $this->baseRenderingContext->getControllerContext()->getRequest()->setFormat($format);
     }
 
     /**
@@ -133,7 +95,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function getFormat()
     {
-        return $this->getRequest()->getFormat();
+        return $this->baseRenderingContext->getControllerContext()->getRequest()->getFormat();
     }
 
     /**
@@ -143,7 +105,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function getRequest()
     {
-        return $this->controllerContext->getRequest();
+        return $this->baseRenderingContext->getControllerContext()->getRequest();
     }
 
     /**
@@ -155,7 +117,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setTemplatePathAndFilename($templatePathAndFilename)
     {
-        $this->templatePathAndFilename = $templatePathAndFilename;
+        $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);
     }
 
     /**
@@ -166,7 +128,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function getTemplatePathAndFilename()
     {
-        return $this->templatePathAndFilename;
+        return $this->baseRenderingContext->getTemplatePaths()->getTemplatePathAndFilename();
     }
 
     /**
@@ -179,7 +141,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setTemplateSource($templateSource)
     {
-        $this->templateSource = $templateSource;
+        $this->baseRenderingContext->getTemplatePaths()->setTemplateSource($templateSource);
     }
 
     /**
@@ -191,51 +153,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setTemplateRootPaths(array $templateRootPaths)
     {
-        $this->templateRootPaths = $templateRootPaths;
-    }
-
-    /**
-     * Set template by name
-     * All set templateRootPaths are checked to find template by given name
-     *
-     * @param string $templateName Name of the template
-     * @throws InvalidTemplateResourceException
-     * @api
-     */
-    public function setTemplate($templateName)
-    {
-        if ($this->templateRootPaths === null) {
-            throw new InvalidTemplateResourceException('No template root path has been specified. Use setTemplateRootPaths().', 1430635895);
-        }
-        $format = $this->getRequest()->getFormat();
-        $templatePathAndFilename = null;
-        $possibleTemplatePaths = $this->buildListOfTemplateCandidates($templateName, $this->templateRootPaths, $format);
-        foreach ($possibleTemplatePaths as $possibleTemplatePath) {
-            if ($this->testFileExistence($possibleTemplatePath)) {
-                $templatePathAndFilename = $possibleTemplatePath;
-                break;
-            }
-        }
-        if ($templatePathAndFilename !== null) {
-            $this->setTemplatePathAndFilename($templatePathAndFilename);
-        } else {
-            throw new InvalidTemplateResourceException('Could not load template file. Tried following paths: "' . implode('", "', $possibleTemplatePaths) . '".', 1430635896);
-        }
-    }
-
-    /**
-     * Set the root path to the layouts.
-     *
-     * @param string $layoutRootPath Root path to the layouts.
-     * @return void
-     * @api
-     * @see setLayoutRootPaths()
-     * @deprecated since Fluid 7; Use setLayoutRootPaths() instead
-     */
-    public function setLayoutRootPath($layoutRootPath)
-    {
-        GeneralUtility::logDeprecatedFunction();
-        $this->setLayoutRootPaths(array($layoutRootPath));
+        $this->baseRenderingContext->getTemplatePaths()->setTemplateRootPaths($templateRootPaths);
     }
 
     /**
@@ -247,22 +165,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setLayoutRootPaths(array $layoutRootPaths)
     {
-        $this->layoutRootPaths = $layoutRootPaths;
-    }
-
-    /**
-     * Returns the first found entry in $this->layoutRootPaths.
-     * Don't use, this might not be the desired result.
-     *
-     * @throws InvalidTemplateResourceException
-     * @return string Path to layout root directory
-     * @deprecated since Fluid 7; Use getLayoutRootPaths() instead
-     */
-    public function getLayoutRootPath()
-    {
-        GeneralUtility::logDeprecatedFunction();
-        $layoutRootPaths = $this->getLayoutRootPaths();
-        return array_shift($layoutRootPaths);
+        $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
     }
 
     /**
@@ -274,44 +177,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function getLayoutRootPaths()
     {
-        if ($this->layoutRootPaths === null && $this->templatePathAndFilename === null) {
-            throw new InvalidTemplateResourceException('No layout root path has been specified. Use setLayoutRootPaths().', 1288091419);
-        }
-        if ($this->layoutRootPaths === null) {
-            $this->layoutRootPaths = array(dirname($this->templatePathAndFilename) . '/Layouts');
-        }
-        return $this->layoutRootPaths;
-    }
-
-    /**
-     * Set the root path to the partials.
-     * If set, overrides the one determined from $this->partialRootPathPattern
-     *
-     * @param string $partialRootPath Root path to the partials. If set, overrides the one determined from $this->partialRootPathPattern
-     * @return void
-     * @api
-     * @see setPartialRootPaths()
-     * @deprecated since Fluid 7; Use setPartialRootPaths() instead
-     */
-    public function setPartialRootPath($partialRootPath)
-    {
-        GeneralUtility::logDeprecatedFunction();
-        $this->setPartialRootPaths(array($partialRootPath));
-    }
-
-    /**
-     * Returns the first found entry in $this->partialRootPaths
-     * Don't use, this might not be the desired result.
-     *
-     * @throws InvalidTemplateResourceException
-     * @return string Path to partial root directory
-     * @deprecated since Fluid 7; Use getPartialRootPaths() instead
-     */
-    public function getPartialRootPath()
-    {
-        GeneralUtility::logDeprecatedFunction();
-        $partialRootPaths = $this->getPartialRootPaths();
-        return array_shift($partialRootPaths);
+        return $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
     }
 
     /**
@@ -324,7 +190,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function setPartialRootPaths(array $partialRootPaths)
     {
-        $this->partialRootPaths = $partialRootPaths;
+        $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
     }
 
     /**
@@ -336,13 +202,7 @@ class StandaloneView extends AbstractTemplateView
      */
     public function getPartialRootPaths()
     {
-        if ($this->partialRootPaths === null && $this->templatePathAndFilename === null) {
-            throw new InvalidTemplateResourceException('No partial root path has been specified. Use setPartialRootPaths().', 1288094511);
-        }
-        if ($this->partialRootPaths === null) {
-            $this->partialRootPaths = array(dirname($this->templatePathAndFilename) . '/Partials');
-        }
-        return $this->partialRootPaths;
+        return $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
     }
 
     /**
@@ -354,216 +214,13 @@ class StandaloneView extends AbstractTemplateView
     public function hasTemplate()
     {
         try {
-            $this->getTemplateSource();
+            $this->baseRenderingContext->getTemplatePaths()->getTemplateSource(
+                $this->baseRenderingContext->getControllerName(),
+                $this->baseRenderingContext->getControllerAction()
+            );
             return true;
         } catch (InvalidTemplateResourceException $e) {
             return false;
         }
     }
-
-    /**
-     * Returns a unique identifier for the resolved template file
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $actionName Name of the action. This argument is not used in this view!
-     * @return string template identifier
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getTemplateIdentifier($actionName = null)
-    {
-        if ($this->templateSource === null) {
-            $templatePathAndFilename = $this->getTemplatePathAndFilename();
-            $templatePathAndFilenameInfo = pathinfo($templatePathAndFilename);
-            $templateFilenameWithoutExtension = basename($templatePathAndFilename, '.' . $templatePathAndFilenameInfo['extension']);
-            $prefix = sprintf('template_file_%s', $templateFilenameWithoutExtension);
-            return $this->createIdentifierForFile($templatePathAndFilename, $prefix);
-        } else {
-            $templateSource = $this->getTemplateSource();
-            $prefix = 'template_source';
-            $templateIdentifier = sprintf('Standalone_%s_%s', $prefix, sha1($templateSource));
-            return $templateIdentifier;
-        }
-    }
-
-    /**
-     * Returns the Fluid template source code
-     *
-     * @param string $actionName Name of the action. This argument is not used in this view!
-     * @return string Fluid template source
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getTemplateSource($actionName = null)
-    {
-        if ($this->templateSource === null && $this->templatePathAndFilename === null) {
-            throw new InvalidTemplateResourceException('No template has been specified. Use either setTemplateSource() or setTemplatePathAndFilename().', 1288085266);
-        }
-        if ($this->templateSource === null) {
-            if (!$this->testFileExistence($this->templatePathAndFilename)) {
-                throw new InvalidTemplateResourceException('Template could not be found at "' . $this->templatePathAndFilename . '".', 1288087061);
-            }
-            $this->templateSource = file_get_contents($this->templatePathAndFilename);
-        }
-        return $this->templateSource;
-    }
-
-    /**
-     * Returns a unique identifier for the resolved layout file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $layoutName The name of the layout
-     * @return string layout identifier
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getLayoutIdentifier($layoutName = 'Default')
-    {
-        $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
-        $prefix = 'layout_' . $layoutName;
-        return $this->createIdentifierForFile($layoutPathAndFilename, $prefix);
-    }
-
-    /**
-     * Resolves the path and file name of the layout file, based on
-     * $this->getLayoutRootPaths() and request format and returns the file contents
-     *
-     * @param string $layoutName Name of the layout to use. If none given, use "Default"
-     * @return string contents of the layout file if it was found
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getLayoutSource($layoutName = 'Default')
-    {
-        $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
-        $layoutSource = file_get_contents($layoutPathAndFilename);
-        if ($layoutSource === false) {
-            throw new InvalidTemplateResourceException('"' . $layoutPathAndFilename . '" is not a valid template resource URI.', 1312215888);
-        }
-        return $layoutSource;
-    }
-
-    /**
-     * Resolve the path and file name of the layout file, based on
-     * $this->getLayoutRootPaths() and request format
-     *
-     * In case a layout has already been set with setLayoutPathAndFilename(),
-     * this method returns that path, otherwise a path and filename will be
-     * resolved using the layoutPathAndFilenamePattern.
-     *
-     * @param string $layoutName Name of the layout to use. If none given, use "Default"
-     * @return string Path and filename of layout files
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getLayoutPathAndFilename($layoutName = 'Default')
-    {
-        $possibleLayoutPaths = $this->buildListOfTemplateCandidates($layoutName, $this->getLayoutRootPaths(), $this->getRequest()->getFormat());
-        foreach ($possibleLayoutPaths as $layoutPathAndFilename) {
-            if ($this->testFileExistence($layoutPathAndFilename)) {
-                return $layoutPathAndFilename;
-            }
-        }
-
-        throw new InvalidTemplateResourceException('Could not load layout file. Tried following paths: "' . implode('", "', $possibleLayoutPaths) . '".', 1288092555);
-    }
-
-    /**
-     * Returns a unique identifier for the resolved partial file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $partialName The name of the partial
-     * @return string partial identifier
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getPartialIdentifier($partialName)
-    {
-        $partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
-        $prefix = 'partial_' . $partialName;
-        return $this->createIdentifierForFile($partialPathAndFilename, $prefix);
-    }
-
-    /**
-     * Resolves the path and file name of the partial file, based on
-     * $this->getPartialRootPath() and request format and returns the file contents
-     *
-     * @param string $partialName The name of the partial
-     * @return string contents of the layout file if it was found
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getPartialSource($partialName)
-    {
-        $partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
-        $partialSource = file_get_contents($partialPathAndFilename);
-        if ($partialSource === false) {
-            throw new InvalidTemplateResourceException('"' . $partialPathAndFilename . '" is not a valid template resource URI.', 1257246932);
-        }
-        return $partialSource;
-    }
-
-    /**
-     * Resolve the partial path and filename based on $this->getPartialRootPaths() and request format
-     *
-     * @param string $partialName The name of the partial
-     * @return string The full path which should be used. The path definitely exists.
-     * @throws InvalidTemplateResourceException
-     */
-    protected function getPartialPathAndFilename($partialName)
-    {
-        $possiblePartialPaths = $this->buildListOfTemplateCandidates($partialName, $this->getPartialRootPaths(), $this->getRequest()->getFormat());
-        foreach ($possiblePartialPaths as $partialPathAndFilename) {
-            if ($this->testFileExistence($partialPathAndFilename)) {
-                return $partialPathAndFilename;
-            }
-        }
-        throw new InvalidTemplateResourceException('Could not load partial file. Tried following paths: "' . implode('", "', $possiblePartialPaths) . '".', 1288092556);
-    }
-
-    /**
-     * Builds a list of possible candidates for a given template name
-     *
-     * @param string $templateName Name of the template to search for
-     * @param array $paths Paths to search in
-     * @param string $format The file format to use. e.g 'html' or 'txt'
-     * @return array Array of paths to search for the template file
-     */
-    protected function buildListOfTemplateCandidates($templateName, array $paths, $format)
-    {
-        $upperCasedTemplateName = $this->ucFileNameInPath($templateName);
-        $possibleTemplatePaths = array();
-        $paths = ArrayUtility::sortArrayWithIntegerKeys($paths);
-        $paths = array_reverse($paths, true);
-        foreach ($paths as $layoutRootPath) {
-            $possibleTemplatePaths[] = $this->resolveFileNamePath($layoutRootPath . '/' . $upperCasedTemplateName . '.' . $format);
-            $possibleTemplatePaths[] = $this->resolveFileNamePath($layoutRootPath . '/' . $upperCasedTemplateName);
-            if ($upperCasedTemplateName !== $templateName) {
-                $possibleTemplatePaths[] = $this->resolveFileNamePath($layoutRootPath . '/' . $templateName . '.' . $format);
-                $possibleTemplatePaths[] = $this->resolveFileNamePath($layoutRootPath . '/' . $templateName);
-            }
-        }
-        return $possibleTemplatePaths;
-    }
-
-    /**
-     * Returns a unique identifier for the given file in the format
-     * Standalone_<prefix>_<SHA1>
-     * The SH1 hash is a checksum that is based on the file path and last modification date
-     *
-     * @param string $pathAndFilename
-     * @param string $prefix
-     * @return string
-     */
-    protected function createIdentifierForFile($pathAndFilename, $prefix)
-    {
-        $templateModifiedTimestamp = filemtime($pathAndFilename);
-        $templateIdentifier = sprintf('Standalone_%s_%s', $prefix, sha1($pathAndFilename . '|' . $templateModifiedTimestamp));
-        $templateIdentifier = str_replace('/', '_', str_replace('.', '_', $templateIdentifier));
-        return $templateIdentifier;
-    }
-
-    /**
-     * Wrapper method to make the static call to GeneralUtility mockable in tests
-     *
-     * @param string $pathAndFilename
-     * @return string absolute pathAndFilename
-     */
-    protected function resolveFileNamePath($pathAndFilename)
-    {
-        return GeneralUtility::getFileAbsFileName(GeneralUtility::fixWindowsFilePath($pathAndFilename), false);
-    }
 }
diff --git a/typo3/sysext/fluid/Classes/View/TemplatePaths.php b/typo3/sysext/fluid/Classes/View/TemplatePaths.php
new file mode 100644
index 000000000000..3206cfe03443
--- /dev/null
+++ b/typo3/sysext/fluid/Classes/View/TemplatePaths.php
@@ -0,0 +1,146 @@
+<?php
+namespace TYPO3\CMS\Fluid\View;
+
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+
+/**
+ * Class TemplatePaths
+ *
+ * Custom implementation for template paths resolving, one which differs from the base
+ * implementation in that it is capable of resolving template paths based on TypoScript
+ * configuration when given a package name, and is aware of the Frontend/Backend contexts of TYPO3.
+ */
+class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths
+{
+    /**
+     * @var array
+     */
+    protected $typoScript = array();
+
+    /**
+     * @var string
+     */
+    protected $templateSource;
+
+    /**
+     * @var string
+     */
+    protected $templatePathAndFilename;
+
+    /**
+     * @param string $extensionKey
+     * @return string|NULL
+     */
+    protected function getExtensionPrivateResourcesPath($extensionKey)
+    {
+        $extensionKey = trim($extensionKey);
+        if ($extensionKey && ExtensionManagementUtility::isLoaded($extensionKey)) {
+            return ExtensionManagementUtility::extPath($extensionKey) . 'Resources/Private/';
+        }
+        return null;
+    }
+
+    /**
+     * @return ConfigurationManagerInterface
+     */
+    protected function getConfigurationManager()
+    {
+        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
+        $configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
+        return $configurationManager;
+    }
+
+    /**
+     * @param string $extensionKey
+     * @return array
+     */
+    protected function getContextSpecificViewConfiguration($extensionKey)
+    {
+        if (empty($extensionKey)) {
+            return array();
+        }
+        if (empty($this->typoScript)) {
+            $this->typoScript = GeneralUtility::removeDotsFromTS(
+                $this->getConfigurationManager()->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
+            );
+        }
+        $signature = str_replace('_', '', $extensionKey);
+        $resources = $this->getExtensionPrivateResourcesPath($extensionKey);
+        $configuration = array();
+        $paths = array(
+            self::CONFIG_TEMPLATEROOTPATHS => array($resources . 'Templates/'),
+            self::CONFIG_PARTIALROOTPATHS => array($resources . 'Partials/'),
+            self::CONFIG_LAYOUTROOTPATHS => array($resources . 'Layouts/')
+        );
+        if (TYPO3_MODE === 'BE' && isset($this->typoScript['module']['tx_' . $signature]['view'])) {
+            $configuration = (array) $this->typoScript['module']['tx_' . $signature]['view'];
+        } elseif (TYPO3_MODE === 'FE' && isset($this->typoScript['plugin']['tx_' . $signature]['view'])) {
+            $configuration = (array) $this->typoScript['plugin']['tx_' . $signature]['view'];
+        }
+        foreach ($paths as $name => $values) {
+            $paths[$name] = $values + (array) $configuration[$name];
+        }
+        return array_map(array($this, 'sanitizePath'), $paths);
+    }
+
+    /**
+     * @return array
+     */
+    public function toArray()
+    {
+        return array(
+            self::CONFIG_TEMPLATEROOTPATHS => $this->sanitizePath($this->getTemplateRootPaths()),
+            self::CONFIG_LAYOUTROOTPATHS => $this->sanitizePath($this->getLayoutRootPaths()),
+            self::CONFIG_PARTIALROOTPATHS => $this->sanitizePath($this->getPartialRootPaths())
+        );
+    }
+
+    /**
+     * @param string|array $path
+     * @return string
+     */
+    protected function sanitizePath($path)
+    {
+        if (is_array($path)) {
+            $paths = array_map(array($this, 'sanitizePath'), $path);
+            return array_unique($paths);
+        }
+        if (substr($path, 0, 1) !== '/') {
+            $path = GeneralUtility::getFileAbsFileName($path);
+        }
+        $path = $this->ensureAbsolutePath($path);
+        if (is_dir($path)) {
+            $path = $this->ensureSuffixedPath($path);
+        }
+        return $path;
+    }
+
+    /**
+     * Fills the path arrays with defaults, by package name.
+     * Reads those defaults from TypoScript if possible and
+     * if not defined, uses fallback paths by convention.
+     *
+     * @param string $packageName
+     * @return void
+     */
+    public function fillDefaultsByPackageName($packageName)
+    {
+        $this->fillFromConfigurationArray($this->getContextSpecificViewConfiguration($packageName));
+    }
+}
diff --git a/typo3/sysext/fluid/Classes/View/TemplateView.php b/typo3/sysext/fluid/Classes/View/TemplateView.php
index 864714394477..4ba2e902973f 100644
--- a/typo3/sysext/fluid/Classes/View/TemplateView.php
+++ b/typo3/sysext/fluid/Classes/View/TemplateView.php
@@ -1,23 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\View;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- * of the License, or (at your option) any later version.                 *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Fluid;
+use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException;
 
 /**
  * The main template view. Should be used as view if you want Fluid Templating
@@ -27,126 +26,19 @@ use TYPO3\CMS\Fluid\Fluid;
 class TemplateView extends AbstractTemplateView
 {
     /**
-     * Pattern to be resolved for "@templateRoot" in the other patterns.
-     * Following placeholders are supported:
-     * - "@packageResourcesPath"
-     *
-     * @var string
-     */
-    protected $templateRootPathPattern = '@packageResourcesPath/Private/Templates';
-
-    /**
-     * Pattern to be resolved for "@partialRoot" in the other patterns.
-     * Following placeholders are supported:
-     * - "@packageResourcesPath"
-     *
-     * @var string
-     */
-    protected $partialRootPathPattern = '@packageResourcesPath/Private/Partials';
-
-    /**
-     * Pattern to be resolved for "@layoutRoot" in the other patterns.
-     * Following placeholders are supported:
-     * - "@packageResourcesPath"
-     *
-     * @var string
-     */
-    protected $layoutRootPathPattern = '@packageResourcesPath/Private/Layouts';
-
-    /**
-     * Path(s) to the template root. If NULL, then $this->templateRootPathPattern will be used.
-     *
-     * @var array
-     */
-    protected $templateRootPaths = null;
-
-    /**
-     * Path(s) to the partial root. If NULL, then $this->partialRootPathPattern will be used.
-     *
-     * @var array
-     */
-    protected $partialRootPaths = null;
-
-    /**
-     * Path(s) to the layout root. If NULL, then $this->layoutRootPathPattern will be used.
-     *
-     * @var array
-     */
-    protected $layoutRootPaths = null;
-
-    /**
-     * File pattern for resolving the template file
-     * Following placeholders are supported:
-     * - "@templateRoot"
-     * - "@partialRoot"
-     * - "@layoutRoot"
-     * - "@subpackage"
-     * - "@action"
-     * - "@format"
-     *
-     * @var string
-     */
-    protected $templatePathAndFilenamePattern = '@templateRoot/@subpackage/@controller/@action.@format';
-
-    /**
-     * Directory pattern for global partials. Not part of the public API, should not be changed for now.
-     * Following placeholders are supported:
-     * - "@templateRoot"
-     * - "@partialRoot"
-     * - "@layoutRoot"
-     * - "@subpackage"
-     * - "@partial"
-     * - "@format"
-     *
-     * @var string
-     */
-    private $partialPathAndFilenamePattern = '@partialRoot/@subpackage/@partial.@format';
-
-    /**
-     * File pattern for resolving the layout
-     * Following placeholders are supported:
-     * - "@templateRoot"
-     * - "@partialRoot"
-     * - "@layoutRoot"
-     * - "@subpackage"
-     * - "@layout"
-     * - "@format"
-     *
-     * @var string
-     */
-    protected $layoutPathAndFilenamePattern = '@layoutRoot/@layout.@format';
-
-    /**
-     * Path and filename of the template file. If set,  overrides the templatePathAndFilenamePattern
-     *
-     * @var string
-     */
-    protected $templatePathAndFilename = null;
-
-    /**
-     * Path and filename of the layout file. If set, overrides the layoutPathAndFilenamePattern
-     *
-     * @var string
-     */
-    protected $layoutPathAndFilename = null;
-
-    /**
-     * Constructor
+     * Init view
      */
-    public function __construct()
+    public function initializeView()
     {
-        $this->templateParser = TemplateParserBuilder::build();
-        $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
-        $this->setRenderingContext($this->objectManager->get(RenderingContextInterface::class));
     }
 
     /**
-     * Init view
+     * @param $templateName
      */
-    public function initializeView()
+    public function setTemplate($templateName)
     {
+        $this->baseRenderingContext->setControllerAction($templateName);
     }
-    // Here, the backporter can insert a constructor method, which is needed for the TYPO3 CMS extension
 
     /**
      * Sets the path and name of of the template file. Effectively overrides the
@@ -158,7 +50,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function setTemplatePathAndFilename($templatePathAndFilename)
     {
-        $this->templatePathAndFilename = $templatePathAndFilename;
+        $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);
     }
 
     /**
@@ -170,21 +62,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function setLayoutPathAndFilename($layoutPathAndFilename)
     {
-        $this->layoutPathAndFilename = $layoutPathAndFilename;
-    }
-
-    /**
-     * Set the root path to the templates.
-     * If set, overrides the one determined from $this->templateRootPathPattern
-     *
-     * @param string $templateRootPath Root path to the templates. If set, overrides the one determined from $this->templateRootPathPattern
-     * @return void
-     * @api
-     * @see setTemplateRootPaths()
-     */
-    public function setTemplateRootPath($templateRootPath)
-    {
-        $this->setTemplateRootPaths(array($templateRootPath));
+        $this->baseRenderingContext->getTemplatePaths()->setLayoutPathAndFilename($layoutPathAndFilename);
     }
 
     /**
@@ -194,12 +72,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function getTemplateRootPaths()
     {
-        if ($this->templateRootPaths !== null) {
-            return $this->templateRootPaths;
-        }
-        /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-        $actionRequest = $this->controllerContext->getRequest();
-        return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->templateRootPathPattern));
+        return $this->baseRenderingContext->getTemplatePaths()->getTemplateRootPaths();
     }
 
     /**
@@ -212,21 +85,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function setTemplateRootPaths(array $templateRootPaths)
     {
-        $this->templateRootPaths = $templateRootPaths;
-    }
-
-    /**
-     * Set the root path to the partials.
-     * If set, overrides the one determined from $this->partialRootPathPattern
-     *
-     * @param string $partialRootPath Root path to the partials. If set, overrides the one determined from $this->partialRootPathPattern
-     * @return void
-     * @api
-     * @see setPartialRootPaths()
-     */
-    public function setPartialRootPath($partialRootPath)
-    {
-        $this->setPartialRootPaths(array($partialRootPath));
+        $this->baseRenderingContext->getTemplatePaths()->setTemplateRootPaths($templateRootPaths);
     }
 
     /**
@@ -239,36 +98,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function setPartialRootPaths(array $partialRootPaths)
     {
-        $this->partialRootPaths = $partialRootPaths;
-    }
-
-    /**
-     * Resolves the partial root to be used inside other paths.
-     *
-     * @return array Path(s) to partial root directory
-     */
-    protected function getPartialRootPaths()
-    {
-        if ($this->partialRootPaths !== null) {
-            return $this->partialRootPaths;
-        }
-        /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-        $actionRequest = $this->controllerContext->getRequest();
-        return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->partialRootPathPattern));
-    }
-
-    /**
-     * Set the root path to the layouts.
-     * If set, overrides the one determined from $this->layoutRootPathPattern
-     *
-     * @param string $layoutRootPath Root path to the layouts. If set, overrides the one determined from $this->layoutRootPathPattern
-     * @return void
-     * @api
-     * @see setLayoutRootPaths()
-     */
-    public function setLayoutRootPath($layoutRootPath)
-    {
-        $this->setLayoutRootPaths(array($layoutRootPath));
+        $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
     }
 
     /**
@@ -281,222 +111,7 @@ class TemplateView extends AbstractTemplateView
      */
     public function setLayoutRootPaths(array $layoutRootPaths)
     {
-        $this->layoutRootPaths = $layoutRootPaths;
-    }
-
-    /**
-     * Resolves the layout root to be used inside other paths.
-     *
-     * @return string Path(s) to layout root directory
-     */
-    protected function getLayoutRootPaths()
-    {
-        if ($this->layoutRootPaths !== null) {
-            return $this->layoutRootPaths;
-        }
-        /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-        $actionRequest = $this->controllerContext->getRequest();
-        return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->layoutRootPathPattern));
-    }
-
-    /**
-     * Returns a unique identifier for the resolved template file
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $actionName Name of the action. If NULL, will be taken from request.
-     * @return string template identifier
-     */
-    protected function getTemplateIdentifier($actionName = null)
-    {
-        $templatePathAndFilename = $this->getTemplatePathAndFilename($actionName);
-        if ($actionName === null) {
-            /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-            $actionRequest = $this->controllerContext->getRequest();
-            $actionName = $actionRequest->getControllerActionName();
-        }
-        $prefix = 'action_' . $actionName;
-        return $this->createIdentifierForFile($templatePathAndFilename, $prefix);
-    }
-
-    /**
-     * Resolve the template path and filename for the given action. If $actionName
-     * is NULL, looks into the current request.
-     *
-     * @param string $actionName Name of the action. If NULL, will be taken from request.
-     * @return string Full path to template
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getTemplateSource($actionName = null)
-    {
-        $templatePathAndFilename = $this->getTemplatePathAndFilename($actionName);
-        $templateSource = file_get_contents($templatePathAndFilename);
-        if ($templateSource === false) {
-            throw new Exception\InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
-        }
-        return $templateSource;
-    }
-
-    /**
-     * Resolve the template path and filename for the given action. If $actionName
-     * is NULL, looks into the current request.
-     *
-     * @param string $actionName Name of the action. If NULL, will be taken from request.
-     * @return string Full path to template
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getTemplatePathAndFilename($actionName = null)
-    {
-        if ($this->templatePathAndFilename !== null) {
-            return $this->resolveFileNamePath($this->templatePathAndFilename);
-        }
-        if ($actionName === null) {
-            /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-            $actionRequest = $this->controllerContext->getRequest();
-            $actionName = $actionRequest->getControllerActionName();
-        }
-
-        $paths = $this->expandGenericPathPattern($this->templatePathAndFilenamePattern, false, false);
-        $possibleFileNames = $this->buildListOfTemplateCandidates($actionName, $paths, '@action');
-        foreach ($possibleFileNames as $templatePathAndFilename) {
-            if ($this->testFileExistence($templatePathAndFilename)) {
-                return $templatePathAndFilename;
-            }
-        }
-        throw new Exception\InvalidTemplateResourceException('Template could not be loaded. I tried "' . implode('", "', $possibleFileNames) . '"', 1225709595);
-    }
-
-    /**
-     * Returns a unique identifier for the resolved layout file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $layoutName The name of the layout
-     * @return string layout identifier
-     */
-    protected function getLayoutIdentifier($layoutName = 'Default')
-    {
-        $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
-        $prefix = 'layout_' . $layoutName;
-        return $this->createIdentifierForFile($layoutPathAndFilename, $prefix);
-    }
-
-    /**
-     * Resolve the path and file name of the layout file, based on
-     * $this->layoutPathAndFilename and $this->layoutPathAndFilenamePattern.
-     *
-     * In case a layout has already been set with setLayoutPathAndFilename(),
-     * this method returns that path, otherwise a path and filename will be
-     * resolved using the layoutPathAndFilenamePattern.
-     *
-     * @param string $layoutName Name of the layout to use. If none given, use "Default"
-     * @return string contents of the layout template
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getLayoutSource($layoutName = 'Default')
-    {
-        $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
-        $layoutSource = file_get_contents($layoutPathAndFilename);
-        if ($layoutSource === false) {
-            throw new Exception\InvalidTemplateResourceException('"' . $layoutPathAndFilename . '" is not a valid template resource URI.', 1257246930);
-        }
-        return $layoutSource;
-    }
-
-    /**
-     * Resolve the path and file name of the layout file, based on
-     * $this->layoutPathAndFilename and $this->layoutPathAndFilenamePattern.
-     *
-     * In case a layout has already been set with setLayoutPathAndFilename(),
-     * this method returns that path, otherwise a path and filename will be
-     * resolved using the layoutPathAndFilenamePattern.
-     *
-     * @param string $layoutName Name of the layout to use. If none given, use "Default"
-     * @return string Path and filename of layout files
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getLayoutPathAndFilename($layoutName = 'Default')
-    {
-        if ($this->layoutPathAndFilename !== null) {
-            return $this->resolveFileNamePath($this->layoutPathAndFilename);
-        }
-        $paths = $this->expandGenericPathPattern($this->layoutPathAndFilenamePattern, true, true);
-        $possibleFileNames = $this->buildListOfTemplateCandidates($layoutName, $paths, '@layout');
-        foreach ($possibleFileNames as $layoutPathAndFilename) {
-            if ($this->testFileExistence($layoutPathAndFilename)) {
-                return $layoutPathAndFilename;
-            }
-        }
-        throw new Exception\InvalidTemplateResourceException('The layout files "' . implode('", "', $possibleFileNames) . '" could not be loaded.', 1225709596);
-    }
-
-    /**
-     * Returns a unique identifier for the resolved partial file.
-     * This identifier is based on the template path and last modification date
-     *
-     * @param string $partialName The name of the partial
-     * @return string partial identifier
-     */
-    protected function getPartialIdentifier($partialName)
-    {
-        $partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
-        $prefix = 'partial_' . $partialName;
-        return $this->createIdentifierForFile($partialPathAndFilename, $prefix);
-    }
-
-    /**
-     * Figures out which partial to use.
-     *
-     * @param string $partialName The name of the partial
-     * @return string contents of the partial template
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getPartialSource($partialName)
-    {
-        $partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
-        $partialSource = file_get_contents($partialPathAndFilename);
-        if ($partialSource === false) {
-            throw new Exception\InvalidTemplateResourceException('"' . $partialPathAndFilename . '" is not a valid template resource URI.', 1257246931);
-        }
-        return $partialSource;
-    }
-
-    /**
-     * Resolve the partial path and filename based on $this->partialPathAndFilenamePattern.
-     *
-     * @param string $partialName The name of the partial
-     * @return string the full path which should be used. The path definitely exists.
-     * @throws Exception\InvalidTemplateResourceException
-     */
-    protected function getPartialPathAndFilename($partialName)
-    {
-        $paths = $this->expandGenericPathPattern($this->partialPathAndFilenamePattern, true, true);
-        $possibleFileNames = $this->buildListOfTemplateCandidates($partialName, $paths, '@partial');
-        foreach ($possibleFileNames as $partialPathAndFilename) {
-            if ($this->testFileExistence($partialPathAndFilename)) {
-                return $partialPathAndFilename;
-            }
-        }
-        throw new Exception\InvalidTemplateResourceException('The partial files "' . implode('", "', $possibleFileNames) . '" could not be loaded.', 1225709597);
-    }
-
-    /**
-     * Builds a list of possible candidates for a given template name
-     *
-     * @param string $templateName
-     * @param array $paths Paths to search in
-     * @param string $marker Marker to replace in the $templateName
-     * @return array Array of paths to search for the template file
-     */
-    protected function buildListOfTemplateCandidates($templateName, $paths, $marker)
-    {
-        $upperCasedTemplateName = $this->ucFileNameInPath($templateName);
-        $possibleFileNames = array();
-        foreach ($paths as $partialPathAndFilename) {
-            $possibleFileNames[] = $this->resolveFileNamePath(str_replace($marker, $upperCasedTemplateName, $partialPathAndFilename));
-            if ($templateName !== $upperCasedTemplateName) {
-                $possibleFileNames[] = $this->resolveFileNamePath(str_replace($marker, $templateName, $partialPathAndFilename));
-            }
-        }
-        return $possibleFileNames;
+        $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
     }
 
     /**
@@ -508,154 +123,14 @@ class TemplateView extends AbstractTemplateView
      */
     public function canRender(ControllerContext $controllerContext)
     {
-        $this->setControllerContext($controllerContext);
         try {
-            $this->getTemplateSource();
+            $request = $controllerContext->getRequest();
+            $this->setControllerContext($controllerContext);
+            $this->baseRenderingContext->getTemplatePaths()->setFormat($request->getFormat());
+            $this->baseRenderingContext->getTemplatePaths()->getTemplateSource($request->getControllerName(), $request->getControllerActionName());
             return true;
-        } catch (Exception\InvalidTemplateResourceException $e) {
+        } catch (InvalidTemplateResourceException $e) {
             return false;
         }
     }
-
-    /**
-     * Processes following placeholders inside $pattern:
-     *  - "@templateRoot"
-     *  - "@partialRoot"
-     *  - "@layoutRoot"
-     *  - "@subpackage"
-     *  - "@controller"
-     *  - "@format"
-     *
-     * This method is used to generate "fallback chains" for file system locations where a certain Partial can reside.
-     *
-     * If $bubbleControllerAndSubpackage is FALSE and $formatIsOptional is FALSE, then the resulting array will only have one element
-     * with all the above placeholders replaced.
-     *
-     * If you set $bubbleControllerAndSubpackage to TRUE, then you will get an array with potentially many elements:
-     * The first element of the array is like above. The second element has the @ controller part set to "" (the empty string)
-     * The third element now has the @ controller part again stripped off, and has the last subpackage part stripped off as well.
-     * This continues until both "@subpackage" and "@controller" are empty.
-     *
-     * Example for $bubbleControllerAndSubpackage is TRUE, we have the Tx_MyExtension_MySubPackage_Controller_MyController
-     * as Controller Object Name and the current format is "html"
-     *
-     * If pattern is "@templateRoot/@subpackage/@controller/@action.@format", then the resulting array is:
-     *  - "Resources/Private/Templates/MySubPackage/My/@action.html"
-     *  - "Resources/Private/Templates/MySubPackage/@action.html"
-     *  - "Resources/Private/Templates/@action.html"
-     *
-     * If you set $formatIsOptional to TRUE, then for any of the above arrays, every element will be duplicated  - once with "@format"
-     * replaced by the current request format, and once with ."@format" stripped off.
-     *
-     * @param string $pattern Pattern to be resolved
-     * @param bool $bubbleControllerAndSubpackage if TRUE, then we successively split off parts from "@controller" and "@subpackage" until both are empty.
-     * @param bool $formatIsOptional if TRUE, then half of the resulting strings will have ."@format" stripped off, and the other half will have it.
-     * @return array unix style paths
-     */
-    protected function expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional)
-    {
-        $paths = array($pattern);
-        $this->expandPatterns($paths, '@templateRoot', $this->getTemplateRootPaths());
-        $this->expandPatterns($paths, '@partialRoot', $this->getPartialRootPaths());
-        $this->expandPatterns($paths, '@layoutRoot', $this->getLayoutRootPaths());
-
-        /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-        $actionRequest = $this->controllerContext->getRequest();
-        $subpackageKey = $actionRequest->getControllerSubpackageKey();
-        $controllerName = $actionRequest->getControllerName();
-        if ($subpackageKey !== null) {
-            if (strpos($subpackageKey, Fluid::NAMESPACE_SEPARATOR) !== false) {
-                $namespaceSeparator = Fluid::NAMESPACE_SEPARATOR;
-            } else {
-                $namespaceSeparator = Fluid::LEGACY_NAMESPACE_SEPARATOR;
-            }
-            $subpackageKeyParts = explode($namespaceSeparator, $subpackageKey);
-        } else {
-            $subpackageKeyParts = array();
-        }
-        if ($bubbleControllerAndSubpackage) {
-            $numberOfPathsBeforeSubpackageExpansion = count($paths);
-            $numberOfSubpackageParts = count($subpackageKeyParts);
-            $subpackageReplacements = array();
-            for ($i = 0; $i <= $numberOfSubpackageParts; $i++) {
-                $subpackageReplacements[] = implode('/', ($i < 0 ? $subpackageKeyParts : array_slice($subpackageKeyParts, $i)));
-            }
-            $this->expandPatterns($paths, '@subpackage', $subpackageReplacements);
-
-            for ($i = ($numberOfPathsBeforeSubpackageExpansion - 1) * ($numberOfSubpackageParts + 1); $i >= 0; $i -= ($numberOfSubpackageParts + 1)) {
-                array_splice($paths, $i, 0, str_replace('@controller', $controllerName, $paths[$i]));
-            }
-            $this->expandPatterns($paths, '@controller', array(''));
-        } else {
-            $i = $controllerName === null ? 0 : -1;
-            $this->expandPatterns($paths, '@subpackage', array(implode('/', $i < 0 ? $subpackageKeyParts :
-                array_slice($subpackageKeyParts, $i))));
-            $this->expandPatterns($paths, '@controller', array($controllerName));
-        }
-
-        if ($formatIsOptional) {
-            $this->expandPatterns($paths, '.@format', array('.' . $actionRequest->getFormat(), ''));
-            $this->expandPatterns($paths, '@format', array($actionRequest->getFormat(), ''));
-        } else {
-            $this->expandPatterns($paths, '.@format', array('.' . $actionRequest->getFormat()));
-            $this->expandPatterns($paths, '@format', array($actionRequest->getFormat()));
-        }
-        return array_values(array_unique($paths));
-    }
-
-    /**
-     * Expands the given $patterns by adding an array element for each $replacement
-     * replacing occurrences of $search.
-     *
-     * @param array $patterns
-     * @param string $search
-     * @param array $replacements
-     * @return void
-     */
-    protected function expandPatterns(array &$patterns, $search, array $replacements)
-    {
-        $patternsWithReplacements = array();
-        foreach ($patterns as $pattern) {
-            foreach ($replacements as $replacement) {
-                $patternsWithReplacements[] = GeneralUtility::fixWindowsFilePath(str_replace($search, $replacement, $pattern));
-            }
-        }
-        $patterns = $patternsWithReplacements;
-    }
-
-    /**
-     * Returns a unique identifier for the given file in the format
-     * <PackageKey>_<SubPackageKey>_<ControllerName>_<prefix>_<SHA1>
-     * The SH1 hash is a checksum that is based on the file path and last modification date
-     *
-     * @param string $pathAndFilename
-     * @param string $prefix
-     * @return string
-     */
-    protected function createIdentifierForFile($pathAndFilename, $prefix)
-    {
-        /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
-        $actionRequest = $this->controllerContext->getRequest();
-        $extensionName = $actionRequest->getControllerExtensionName();
-        $subPackageKey = $actionRequest->getControllerSubpackageKey();
-        if ($subPackageKey !== null) {
-            $extensionName .= '_' . $subPackageKey;
-        }
-        $controllerName = $actionRequest->getControllerName();
-        $templateModifiedTimestamp = filemtime($pathAndFilename);
-        $templateIdentifier = sprintf('%s_%s_%s_%s', $extensionName, $controllerName, $prefix, sha1($pathAndFilename . '|' . $templateModifiedTimestamp));
-        return $templateIdentifier;
-    }
-
-    /**
-     * Wrapper method to make the static call to GeneralUtility mockable in tests
-     *
-     * @param string $pathAndFilename
-     *
-     * @return string absolute pathAndFilename
-     */
-    protected function resolveFileNamePath($pathAndFilename)
-    {
-        return GeneralUtility::getFileAbsFileName(GeneralUtility::fixWindowsFilePath($pathAndFilename), true);
-    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/AliasViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/AliasViewHelper.php
deleted file mode 100644
index 2bc000d85ef2..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/AliasViewHelper.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Declares new variables which are aliases of other variables.
- * Takes a "map"-Parameter which is an associative array which defines the shorthand mapping.
- *
- * The variables are only declared inside the <f:alias>...</f:alias>-tag. After the
- * closing tag, all declared variables are removed again.
- *
- * = Examples =
- *
- * <code title="Single alias">
- * <f:alias map="{x: 'foo'}">{x}</f:alias>
- * </code>
- * <output>
- * foo
- * </output>
- *
- * <code title="Multiple mappings">
- * <f:alias map="{x: foo.bar.baz, y: foo.bar.baz.name}">
- *   {x.name} or {y}
- * </f:alias>
- * </code>
- * <output>
- * [name] or [name]
- * depending on {foo.bar.baz}
- * </output>
- *
- * @api
- */
-class AliasViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Declare aliases
-     *
-     * @param array $map array that specifies which variables should be mapped to which alias
-     * @return string Rendered string
-     * @api
-     */
-    public function render(array $map)
-    {
-        return static::renderStatic(
-            array('map' => $map),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Declare aliases
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $map = $arguments['map'];
-        $templateVariableContainer = $renderingContext->getTemplateVariableContainer();
-
-        foreach ($map as $aliasName => $value) {
-            $templateVariableContainer->add($aliasName, $value);
-        }
-        $output = $renderChildrenClosure();
-        foreach ($map as $aliasName => $value) {
-            $templateVariableContainer->remove($aliasName);
-        }
-        return $output;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/BaseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/BaseViewHelper.php
index 23e59b7e2979..bc7c3e553c75 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/BaseViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/BaseViewHelper.php
@@ -1,23 +1,25 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
- * View helper which creates a <base href="..."></base> tag. The Base URI
- * is taken from the current request.
+ * View helper which creates a <base href="..."></base> tag. The Base URI is taken from the
+ * current request.
  * In TYPO3 Flow, you should always include this ViewHelper to make the links work.
  *
  * = Examples =
@@ -32,7 +34,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class BaseViewHelper extends AbstractViewHelper implements CompilableInterface
+class BaseViewHelper extends AbstractViewHelper
 {
     /**
      * Render the "Base" tag by outputting $request->getBaseUri()
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php
index 872475cd3227..d72713ad192b 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\Page\PageRenderer;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php
index 19c94407cea9..42165470a670 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php
@@ -1,36 +1,27 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
  * View helper which returns CSH (context sensitive help) button with icon
- * Note: The CSH button will only work, if the current BE user has
- * the "Context Sensitive Help mode" set to something else than
- * "Display no help information" in the Users settings
+ * Note: The CSH button will only work, if the current BE user has the "Context Sensitive Help mode"
+ * set to something else than "Display no help information" in the Users settings
  * Note: This view helper is experimental!
  *
  * = Examples =
@@ -49,29 +40,17 @@ use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
  * CSH button as known from the TYPO3 backend with some custom settings.
  * </output>
  */
-class CshViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class CshViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Render context sensitive help (CSH) for the given table
      *
      * @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
      * @param string $field Field name (CSH locallang main key)
-     * @param bool $iconOnly Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
-     * @param string $styleAttributes Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
      * @return string the rendered CSH icon
      */
-    public function render($table = null, $field = '', $iconOnly = false, $styleAttributes = '')
+    public function render($table = null, $field = '')
     {
-        if ($iconOnly) {
-            \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
-                'The option iconOnly has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.'
-            );
-        }
-        if ($styleAttributes) {
-            \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
-                'The option styleAttributes has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.'
-            );
-        }
         return static::renderStatic(
             array(
                 'table' => $table,
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php
deleted file mode 100644
index b415c56c5e86..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconFactory;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
-
-/**
- * View helper which returns a button icon
- *
- * = Examples =
- *
- * <code title="Default">
- * <f:be.buttons.icon uri="{f:uri.action()}" />
- * </code>
- * <output>
- * An icon button as known from the TYPO3 backend, skinned and linked with the default action of the current controller.
- * Note: By default the "close" icon is used as image
- * </output>
- *
- * <code title="Default">
- * <f:be.buttons.icon uri="{f:uri.action(action:'new')}" icon="actions-document-new" title="Create new Foo" />
- * </code>
- *
- * <code title="Default">
- * <f:be.buttons.icon icon="actions-document-new" title="Create new Foo" />
- * </code>
- * <output>
- * Here the "actions-document-new" icon is returned, but without link.
- * </output>
- * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
- */
-class IconViewHelper extends AbstractBackendViewHelper implements CompilableInterface
-{
-    /**
-     * Renders a linked icon as known from the TYPO3 backend.
-     *
-     * If the URI is left empty, the icon is rendered without link.
-     *
-     * @param string $uri The target URI for the link. If you want to execute JavaScript here, prefix the URI with
-     *     "javascript:". Leave empty to render just an icon.
-     * @param string $icon Icon to be used.
-     * @param string $title Title attribute of the icon construct
-     * @param array $additionalAttributes Additional tag attributes. They will be added directly to the resulting HTML tag.
-     *
-     * @return string The rendered icon with or without link
-     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
-     */
-    public function render($uri = '', $icon = 'actions-document-close', $title = '', $additionalAttributes = array())
-    {
-        return static::renderStatic(
-            array(
-                'uri' => $uri,
-                'icon' => $icon,
-                'title' => $title,
-                'additionalAttributes' => $additionalAttributes
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * @param array $arguments
-     * @param callable $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        GeneralUtility::logDeprecatedFunction();
-        $uri = $arguments['uri'];
-        $icon = $arguments['icon'];
-        $title = $arguments['title'];
-        $additionalAttributes = $arguments['additionalAttributes'];
-        $additionalTagAttributes = '';
-        $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-        $icon = '<span title="' . htmlspecialchars($title) . '">' . $iconFactory->getIcon($icon, Icon::SIZE_SMALL)->render() . '</span>';
-        if (empty($uri)) {
-            return $icon;
-        }
-
-        if ($additionalAttributes) {
-            foreach ($additionalAttributes as $argumentKey => $argumentValue) {
-                $additionalTagAttributes .= ' ' . $argumentKey . '="' . htmlspecialchars($argumentValue) . '"';
-            }
-        }
-        return '<a href="' . $uri . '"' . $additionalTagAttributes . '>' . $icon . '</a>';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/ShortcutViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/ShortcutViewHelper.php
index 5d55858ea6f3..de0945df50b4 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/ShortcutViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/ShortcutViewHelper.php
@@ -1,30 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
@@ -51,15 +43,13 @@ use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
  * Normally you won't need to set getVars & setVars parameters in Extbase modules
  * </output>
  */
-class ShortcutViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class ShortcutViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Renders a shortcut button as known from the TYPO3 backend
      *
-     * @param array $getVars list of GET variables to store. By default the current id, module and all module arguments
-     *     will be stored
-     * @param array $setVars list of SET[] variables to store. See
-     *     \TYPO3\CMS\Backend\Template\DocumentTemplate::makeShortcutIcon(). Normally won't be used by Extbase modules
+     * @param array $getVars list of GET variables to store. By default the current id, module and all module arguments will be stored
+     * @param array $setVars list of SET[] variables to store. See DocumentTemplate::makeShortcutIcon(). Normally won't be used by Extbase modules
      *
      * @return string the rendered shortcut button
      * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::makeShortcutIcon()
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php
index 6f2e6264a225..492cc9bd1f35 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php
index 2aba677606b3..845a81a322f9 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php
@@ -13,11 +13,9 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * View helper for rendering a styled content infobox markup.
@@ -49,7 +47,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class InfoboxViewHelper extends AbstractViewHelper implements CompilableInterface
+class InfoboxViewHelper extends AbstractViewHelper
 {
     const STATE_NOTICE = -2;
     const STATE_INFO = -1;
@@ -57,6 +55,11 @@ class InfoboxViewHelper extends AbstractViewHelper implements CompilableInterfac
     const STATE_WARNING = 1;
     const STATE_ERROR = 2;
 
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
+
     /**
      * @param string $title The title of the info box
      * @param string $message The message of the info box, if NULL tag content is used
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemGroupViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemGroupViewHelper.php
index a609287ec8c8..0f45c7ceaa0f 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemGroupViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemGroupViewHelper.php
@@ -5,7 +5,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus;
  * 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 3
+ * 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
@@ -13,8 +13,8 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
+use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
 
 /**
  * View helper which groups options of an option tag.
@@ -58,4 +58,19 @@ class ActionMenuItemGroupViewHelper extends ActionMenuViewHelper
         $this->tag->setContent($options);
         return $this->tag->render();
     }
+
+    /**
+     * @param string $argumentsName
+     * @param string $closureName
+     * @param string $initializationPhpCode
+     * @param ViewHelperNode $node
+     * @param TemplateCompiler $compiler
+     * @return null
+     */
+    public function compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
+    {
+        // @TODO: replace with a true compiling method to make compilable!
+        $compiler->disable();
+        return null;
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php
index e8b8310a0130..7d1d40623626 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * View helper which returns an option tag.
  * This view helper only works in conjunction with \TYPO3\CMS\Fluid\ViewHelpers\Be\Menus\ActionMenuViewHelper
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php
index 1d707c5b42d2..19869fe4a205 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php
@@ -1,25 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
+
 /**
  * View helper which returns a select box, that can be used to switch between
  * multiple actions and controllers and looks similar to TYPO3s funcMenu.
@@ -48,7 +45,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus;
  * localized selectbox
  * <output>
  */
-class ActionMenuViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface
+class ActionMenuViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper
 {
     /**
      * @var string
@@ -92,4 +89,19 @@ class ActionMenuViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagB
         $this->tag->setContent($options);
         return '<div class="docheader-funcmenu">' . $this->tag->render() . '</div>';
     }
+
+    /**
+     * @param string $argumentsName
+     * @param string $closureName
+     * @param string $initializationPhpCode
+     * @param ViewHelperNode $node
+     * @param TemplateCompiler $compiler
+     * @return null
+     */
+    public function compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
+    {
+        // @TODO: replace with a true compiling method to make compilable!
+        $compiler->disable();
+        return null;
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
index 97eb2f2a1a8c..0759a972d215 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
@@ -1,32 +1,24 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * View helper which return page info icon as known from TYPO3 backend modules
@@ -41,7 +33,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * Page info icon with context menu
  * </output>
  */
-class PageInfoViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class PageInfoViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Render javascript in header
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
index 7f928d4d7519..4f63805ffc13 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
@@ -1,30 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * View helper which returns the current page path as known from TYPO3 backend modules
@@ -39,7 +31,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * Current page path, prefixed with "Path:" and wrapped in a span with the class "typo3-docheader-pagePath"
  * </output>
  */
-class PagePathViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class PagePathViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Renders the current page path
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php
index 8d11518e859f..a301e6158ac0 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Security;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This view helper implements an ifAuthenticated/else condition for BE users/groups.
  *
@@ -63,4 +57,16 @@ class IfAuthenticatedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abstrac
     {
         return (isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER']->user['uid'] > 0);
     }
+
+    /**
+     * @return mixed
+     */
+    public function render()
+    {
+        if (static::evaluateCondition($this->arguments)) {
+            return $this->renderThenChild();
+        } else {
+            return $this->renderElseChild();
+        }
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php
index 9a110f5dd207..9b98e64059bc 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Security;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This view helper implements an ifHasRole/else condition for BE users/groups.
  *
@@ -101,4 +95,16 @@ class IfHasRoleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractCondi
         }
         return false;
     }
+
+    /**
+     * @return mixed
+     */
+    public function render()
+    {
+        if (static::evaluateCondition($this->arguments)) {
+            return $this->renderThenChild();
+        } else {
+            return $this->renderElseChild();
+        }
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
index c989b15b05fc..5673181af8d3 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
@@ -1,25 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * View helper which renders a record list as known from the TYPO3 list module
  * Note: This feature is experimental!
@@ -67,21 +64,14 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
      * @param bool $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
      * @param bool $enableClickMenu enables context menu
      * @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info
-     * @param bool $alternateBackgroundColors Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
      * @return string the rendered record list
      * @see \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
      */
-    public function render($tableName, array $fieldList = array(), $storagePid = null, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = false, $readOnly = false, $enableClickMenu = true, $clickTitleMode = null, $alternateBackgroundColors = false)
+    public function render($tableName, array $fieldList = array(), $storagePid = null, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = false, $readOnly = false, $enableClickMenu = true, $clickTitleMode = null)
     {
-        if ($alternateBackgroundColors) {
-            \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
-                'The option alternateBackgroundColors has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.'
-            );
-        }
-
-        $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
+        $pageinfo = BackendUtility::readPageAccess(GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
         /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
-        $dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
+        $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
         $dblist->pageRow = $pageinfo;
         if ($readOnly === false) {
             $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
@@ -94,7 +84,7 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
             $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
             $storagePid = $frameworkConfiguration['persistence']['storagePid'];
         }
-        $dblist->start($storagePid, $tableName, (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
+        $dblist->start($storagePid, $tableName, (int)GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
         $dblist->allFields = true;
         $dblist->dontShowClipControlPanels = true;
         $dblist->displayFields = false;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php
index d927bdcd0594..e323dd8878a1 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php
@@ -1,23 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller;
 
-/*                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+/**
+ * Class PaginateController
+ */
 class PaginateController extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController
 {
     /**
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php
index bd8791082857..fe920d8571c4 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php
@@ -1,23 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Widget;
 
-/*                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This ViewHelper renders a Pagination of objects for the TYPO3 Backend.
  *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php
index 899983cea878..e7def510de19 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php
@@ -1,18 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * This ViewHelper renders CObjects from the global TypoScript configuration.
  *
@@ -42,12 +45,18 @@ namespace TYPO3\CMS\Fluid\ViewHelpers;
 class CObjectViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
+     * Disable escaping of child nodes' output
+     *
+     * @var bool
+     */
+    protected $escapeChildren = false;
+
+    /**
+     * Disable escaping of this node's output
      *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
 
     /**
      * @var array
@@ -100,14 +109,14 @@ class CObjectViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
             $data = array($data);
         }
         /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject */
-        $contentObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
+        $contentObject = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
         $contentObject->start($data, $table);
         if ($currentValue !== null) {
             $contentObject->setCurrentVal($currentValue);
         } elseif ($currentValueKey !== null && isset($data[$currentValueKey])) {
             $contentObject->setCurrentVal($data[$currentValueKey]);
         }
-        $pathSegments = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('.', $typoscriptObjectPath);
+        $pathSegments = GeneralUtility::trimExplode('.', $typoscriptObjectPath);
         $lastSegment = array_pop($pathSegments);
         $setup = $this->typoScriptSetup;
         foreach ($pathSegments as $segment) {
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
deleted file mode 100644
index ad5361cf37aa..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Case view helper that is only usable within the SwitchViewHelper.
- * @see \TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper
- *
- * @api
- */
-class CaseViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * @param mixed $value The switch value. If it matches, the child will be rendered
-     * @param bool $default If this is set, this child will be rendered, if none else matches
-     *
-     * @return string the contents of this view helper if $value equals the expression of the surrounding switch view helper, or $default is TRUE. otherwise an empty string
-     * @throws Exception
-     *
-     * @api
-     */
-    public function render($value = null, $default = false)
-    {
-        return static::renderStatic(
-            array(
-                'value' => $value,
-                'default' => $default
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * @param array $arguments
-     * @param callable $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return mixed|string
-     * @throws Exception
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $arguments['value'];
-        $default = $arguments['default'];
-        $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
-        if (!$viewHelperVariableContainer->exists(SwitchViewHelper::class, 'stateStack')) {
-            throw new Exception('The case View helper can only be used within a switch View helper', 1368112037);
-        }
-        if (is_null($value) && $default === false) {
-            throw new Exception('The case View helper must have either value or default argument', 1382867521);
-        }
-        $stateStack = $viewHelperVariableContainer->get(SwitchViewHelper::class, 'stateStack');
-        $currentState = array_pop($stateStack);
-
-        if ($currentState['break'] === true) {
-            return '';
-        }
-
-        // non-type-safe comparison by intention
-        if ($default === true || $currentState['expression'] == $value) {
-            $currentState['break'] = true;
-            $stateStack[] = $currentState;
-            $viewHelperVariableContainer->addOrUpdate(SwitchViewHelper::class, 'stateStack', $stateStack);
-            return $renderChildrenClosure();
-        }
-
-        return '';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CommentViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CommentViewHelper.php
deleted file mode 100644
index eaddb1f4bb27..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CommentViewHelper.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler;
-use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * This ViewHelper prevents rendering of any content inside the tag
- * Note: Contents of the comment will still be **parsed** thus throwing an
- * Exception if it contains syntax errors. You can put child nodes in
- * CDATA tags to avoid this.
- *
- * = Examples =
- *
- * <code title="Commenting out fluid code">
- * Before
- * <f:comment>
- *   This is completely hidden.
- *   <f:debug>This does not get parsed</f:debug>
- * </f:comment>
- * After
- * </code>
- * <output>
- * Before
- * After
- * </output>
- *
- * <code title="Prevent parsing">
- * <f:comment><![CDATA[
- *  <f:some.invalid.syntax />
- * ]]></f:comment>
- * </code>
- * <output>
- * </output>
- *
- * @api
- */
-class CommentViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = false;
-
-    /**
-     * Comments out the tag content
-     *
-     * @return string
-     * @api
-     */
-    public function render()
-    {
-        return '';
-    }
-
-    /**
-     * The inner contents of a comment should not be rendered.
-     *
-     * @param string $argumentsVariableName
-     * @param string $renderChildrenClosureVariableName
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, AbstractNode $syntaxTreeNode, TemplateCompiler $templateCompiler)
-    {
-        return '\'\'';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CountViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CountViewHelper.php
deleted file mode 100644
index 1c5a47039e65..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CountViewHelper.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * This ViewHelper counts elements of the specified array or countable object.
- *
- * = Examples =
- *
- * <code title="Count array elements">
- * <f:count subject="{0:1, 1:2, 2:3, 3:4}" />
- * </code>
- * <output>
- * 4
- * </output>
- *
- * <code title="inline notation">
- * {objects -> f:count()}
- * </code>
- * <output>
- * 10 (depending on the number of items in {objects})
- * </output>
- *
- * @api
- */
-class CountViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = false;
-
-    /**
-     * Counts the items of a given property.
-     *
-     * @param array $subject The array or \Countable to be counted
-     * @return int The number of elements
-     * @throws Exception
-     * @api
-     */
-    public function render($subject = null)
-    {
-        return static::renderStatic(
-            array('subject' => $subject),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * @param array $arguments
-     * @param callable $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return int
-     * @throws Exception
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $subject = $arguments['subject'];
-        if ($subject === null) {
-            $subject = $renderChildrenClosure();
-        }
-        if (is_object($subject) && !$subject instanceof \Countable) {
-            throw new Exception('CountViewHelper only supports arrays and objects implementing \Countable interface. Given: "' . get_class($subject) . '"', 1279808078);
-        }
-        return count($subject);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CycleViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CycleViewHelper.php
deleted file mode 100644
index fa7d4b14c43a..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CycleViewHelper.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * This ViewHelper cycles through the specified values.
- * This can be often used to specify CSS classes for example.
- * **Note:** To achieve the "zebra class" effect in a loop you can also use the "iteration" argument of the **for** ViewHelper.
- *
- * = Examples =
- *
- * <code title="Simple">
- * <f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo"><f:cycle values="{0: 'foo', 1: 'bar', 2: 'baz'}" as="cycle">{cycle}</f:cycle></f:for>
- * </code>
- * <output>
- * foobarbazfoo
- * </output>
- *
- * <code title="Alternating CSS class">
- * <ul>
- *   <f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo">
- *     <f:cycle values="{0: 'odd', 1: 'even'}" as="zebraClass">
- *       <li class="{zebraClass}">{foo}</li>
- *     </f:cycle>
- *   </f:for>
- * </ul>
- * </code>
- * <output>
- * <ul>
- *   <li class="odd">1</li>
- *   <li class="even">2</li>
- *   <li class="odd">3</li>
- *   <li class="even">4</li>
- * </ul>
- * </output>
- *
- * @api
- */
-class CycleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
-{
-    /**
-     * the values to be iterated through
-     *
-     * @var array|\TYPO3\CMS\Extbase\Persistence\ObjectStorage
-     */
-    protected $values = null;
-
-    /**
-     * current values index
-     *
-     * @var int
-     */
-    protected $currentCycleIndex = null;
-
-    /**
-     * @param array $values The array or object implementing \ArrayAccess (for example \TYPO3\CMS\Extbase\Persistence\ObjectStorage) to iterated over
-     * @param string $as The name of the iteration variable
-     * @return string Rendered result
-     * @api
-     */
-    public function render($values, $as)
-    {
-        if ($values === null) {
-            return $this->renderChildren();
-        }
-        if ($this->values === null) {
-            $this->initializeValues($values);
-        }
-        if ($this->currentCycleIndex === null || $this->currentCycleIndex >= count($this->values)) {
-            $this->currentCycleIndex = 0;
-        }
-
-        $currentValue = isset($this->values[$this->currentCycleIndex]) ? $this->values[$this->currentCycleIndex] : null;
-        $this->templateVariableContainer->add($as, $currentValue);
-        $output = $this->renderChildren();
-        $this->templateVariableContainer->remove($as);
-
-        $this->currentCycleIndex ++;
-
-        return $output;
-    }
-
-    /**
-     * Sets this->values to the current values argument and resets $this->currentCycleIndex.
-     *
-     * @param array|\Traversable $values The array or \TYPO3\CMS\Extbase\Persistence\ObjectStorage to be stored in $this->values
-     * @return void
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    protected function initializeValues($values)
-    {
-        if (is_object($values)) {
-            if (!$values instanceof \Traversable) {
-                throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('CycleViewHelper only supports arrays and objects implementing \Traversable interface', 1248728394);
-            }
-            $this->values = iterator_to_array($values, false);
-        } else {
-            $this->values = array_values($values);
-        }
-        $this->currentCycleIndex = 0;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/DebugViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/DebugViewHelper.php
index 2602aef25db8..ea2771009052 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/DebugViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/DebugViewHelper.php
@@ -1,23 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * This ViewHelper generates a HTML dump of the tagged variable.
@@ -38,8 +37,18 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * [A HTML view of the var_dump]
  * </output>
  */
-class DebugViewHelper extends AbstractViewHelper implements CompilableInterface
+class DebugViewHelper extends AbstractViewHelper
 {
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
+
     /**
      * A wrapper for \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump().
      *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/ElseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/ElseViewHelper.php
deleted file mode 100644
index f0f7a1c3e8e9..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/ElseViewHelper.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Else-Branch of a condition. Only has an effect inside of "If". See the If-ViewHelper for documentation.
- *
- * = Examples =
- *
- * <code title="Output content if condition is not met">
- * <f:if condition="{someCondition}">
- *   <f:else>
- *     condition was not true
- *   </f:else>
- * </f:if>
- * </code>
- * <output>
- * Everything inside the "else" tag is displayed if the condition evaluates to FALSE.
- * Otherwise nothing is outputted in this example.
- * </output>
- *
- * @see TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper
- * @api
- */
-class ElseViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * @return string the rendered string
-     * @api
-     */
-    public function render()
-    {
-        return static::renderStatic(
-            array(),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Render children
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        return $renderChildrenClosure();
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
index 406347a050dc..3e5f72694560 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
@@ -1,26 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-use TYPO3\CMS\Core\Utility\GeneralUtility;
+/*
+ * 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!
+ */
 
 /**
  * View helper which renders the flash messages (if there are any) as an unsorted list.
@@ -85,9 +77,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class FlashMessagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper
 {
-    const RENDER_MODE_UL = 'ul';
-    const RENDER_MODE_DIV = 'div';
-
     /**
      * @var string
      */
@@ -111,31 +100,22 @@ class FlashMessagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractT
      * from being cached.
      *
      * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::no_cache
-     * @param string $renderMode @deprecated since TYPO3 CMS 7.3. If you need custom output, use <f:flashMessages as="messages"><f:for each="messages" as="message">...</f:for></f:flashMessages>
      * @param string $as The name of the current flashMessage variable for rendering inside
      * @return string rendered Flash Messages, if there are any.
      * @api
      */
-    public function render($renderMode = null, $as = null)
+    public function render($as = null)
     {
         $queueIdentifier = isset($this->arguments['queueIdentifier']) ? $this->arguments['queueIdentifier'] : null;
-        $flashMessages = $this->controllerContext->getFlashMessageQueue($queueIdentifier)->getAllMessagesAndFlush();
+        $flashMessages = $this->renderingContext->getControllerContext()->getFlashMessageQueue($queueIdentifier)->getAllMessagesAndFlush();
         if ($flashMessages === null || count($flashMessages) === 0) {
             return '';
         }
-        if ($renderMode !== null) {
-            GeneralUtility::deprecationLog('renderMode has been deprecated in TYPO3 CMS 7.3 and will be removed in TYPO3 CMS 8');
-            if ($renderMode === self::RENDER_MODE_DIV) {
-                $content = $this->renderDiv($flashMessages);
-            } else {
-                $content = $this->renderAsList($flashMessages);
-            }
+
+        if ($as === null) {
+            $content = $this->renderAsList($flashMessages);
         } else {
-            if ($as === null) {
-                $content = $this->renderAsList($flashMessages);
-            } else {
-                $content = $this->renderFromTemplate($flashMessages, $as);
-            }
+            $content = $this->renderFromTemplate($flashMessages, $as);
         }
 
         return $content;
@@ -184,27 +164,4 @@ class FlashMessagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractT
 
         return $content;
     }
-
-    /**
-     * Renders the flash messages as nested divs
-     *
-     * @deprecated in 7.3 will be removed in 8.0
-     * @param array $flashMessages \TYPO3\CMS\Core\Messaging\FlashMessage[]
-     * @return string
-     */
-    protected function renderDiv(array $flashMessages)
-    {
-        $this->tag->setTagName('div');
-        if ($this->hasArgument('class')) {
-            $this->tag->addAttribute('class', $this->arguments['class']);
-        } else {
-            $this->tag->addAttribute('class', 'typo3-messages');
-        }
-        $tagContent = '';
-        foreach ($flashMessages as $singleFlashMessage) {
-            $tagContent .= $singleFlashMessage->render();
-        }
-        $this->tag->setContent($tagContent);
-        return $this->tag->render();
-    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php
deleted file mode 100644
index a7db77c24fcf..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Loop view helper which can be used to interate over array.
- * Implements what a basic foreach()-PHP-method does.
- *
- * = Examples =
- *
- * <code title="Simple Loop">
- * <f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo">{foo}</f:for>
- * </code>
- * <output>
- * 1234
- * </output>
- *
- * <code title="Output array key">
- * <ul>
- *   <f:for each="{fruit1: 'apple', fruit2: 'pear', fruit3: 'banana', fruit4: 'cherry'}" as="fruit" key="label">
- *     <li>{label}: {fruit}</li>
- *   </f:for>
- * </ul>
- * </code>
- * <output>
- * <ul>
- *   <li>fruit1: apple</li>
- *   <li>fruit2: pear</li>
- *   <li>fruit3: banana</li>
- *   <li>fruit4: cherry</li>
- * </ul>
- * </output>
- *
- * <code title="Iteration information">
- * <ul>
- *   <f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo" iteration="fooIterator">
- *     <li>Index: {fooIterator.index} Cycle: {fooIterator.cycle} Total: {fooIterator.total}{f:if(condition: fooIterator.isEven, then: ' Even')}{f:if(condition: fooIterator.isOdd, then: ' Odd')}{f:if(condition: fooIterator.isFirst, then: ' First')}{f:if(condition: fooIterator.isLast, then: ' Last')}</li>
- *   </f:for>
- * </ul>
- * </code>
- * <output>
- * <ul>
- *   <li>Index: 0 Cycle: 1 Total: 4 Odd First</li>
- *   <li>Index: 1 Cycle: 2 Total: 4 Even</li>
- *   <li>Index: 2 Cycle: 3 Total: 4 Odd</li>
- *   <li>Index: 3 Cycle: 4 Total: 4 Even Last</li>
- * </ul>
- * </output>
- *
- * @api
- */
-class ForViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-{
-    /**
-     * Iterates through elements of $each and renders child nodes
-     *
-     * @param array $each The array or \TYPO3\CMS\Extbase\Persistence\ObjectStorage to iterated over
-     * @param string $as The name of the iteration variable
-     * @param string $key The name of the variable to store the current array key
-     * @param bool $reverse If enabled, the iterator will start with the last element and proceed reversely
-     * @param string $iteration The name of the variable to store iteration information (index, cycle, isFirst, isLast, isEven, isOdd)
-     * @return string Rendered string
-     * @api
-     */
-    public function render($each, $as, $key = '', $reverse = false, $iteration = null)
-    {
-        return static::renderStatic(
-            $this->arguments,
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $templateVariableContainer = $renderingContext->getTemplateVariableContainer();
-        if ($arguments['each'] === null) {
-            return '';
-        }
-        if (is_object($arguments['each']) && !$arguments['each'] instanceof \Traversable) {
-            throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('ForViewHelper only supports arrays and objects implementing \Traversable interface', 1248728393);
-        }
-
-        if ($arguments['reverse'] === true) {
-            // array_reverse only supports arrays
-            if (is_object($arguments['each'])) {
-                $arguments['each'] = iterator_to_array($arguments['each']);
-            }
-            $arguments['each'] = array_reverse($arguments['each']);
-        }
-        if ($arguments['iteration'] !== null) {
-            $iterationData = array(
-                'index' => 0,
-                'cycle' => 1,
-                'total' => count($arguments['each'])
-            );
-        }
-
-        $output = '';
-        foreach ($arguments['each'] as $keyValue => $singleElement) {
-            $templateVariableContainer->add($arguments['as'], $singleElement);
-            if ($arguments['key'] !== '') {
-                $templateVariableContainer->add($arguments['key'], $keyValue);
-            }
-            if ($arguments['iteration'] !== null) {
-                $iterationData['isFirst'] = $iterationData['cycle'] === 1;
-                $iterationData['isLast'] = $iterationData['cycle'] === $iterationData['total'];
-                $iterationData['isEven'] = $iterationData['cycle'] % 2 === 0;
-                $iterationData['isOdd'] = !$iterationData['isEven'];
-                $templateVariableContainer->add($arguments['iteration'], $iterationData);
-                $iterationData['index']++;
-                $iterationData['cycle']++;
-            }
-            $output .= $renderChildrenClosure();
-            $templateVariableContainer->remove($arguments['as']);
-            if ($arguments['key'] !== '') {
-                $templateVariableContainer->remove($arguments['key']);
-            }
-            if ($arguments['iteration'] !== null) {
-                $templateVariableContainer->remove($arguments['iteration']);
-            }
-        }
-        return $output;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
index 7e8203f2bdc5..423c900c5e56 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
@@ -1,28 +1,19 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
 
 /**
@@ -105,7 +96,7 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
      */
     protected function getRequest()
     {
-        return $this->controllerContext->getRequest();
+        return $this->renderingContext->getControllerContext()->getRequest();
     }
 
     /**
@@ -141,36 +132,6 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
         return $name;
     }
 
-    /**
-     * Get the value of this form element.
-     * Either returns arguments['value'], or the correct value for Object Access.
-     *
-     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
-     * @param bool $convertObjects whether or not to convert objects to identifiers
-     * @return mixed Value
-     */
-    protected function getValue($convertObjects = true)
-    {
-        $value = null;
-        GeneralUtility::logDeprecatedFunction();
-
-        if ($this->hasArgument('value')) {
-            $value = $this->arguments['value'];
-        } elseif ($this->isObjectAccessorMode()) {
-            if ($this->hasMappingErrorOccurred()) {
-                $value = $this->getLastSubmittedFormData();
-            } else {
-                $value = $this->getPropertyValue();
-            }
-            $this->addAdditionalIdentityPropertiesIfNeeded();
-        }
-
-        if ($convertObjects) {
-            $value = $this->convertToPlainValue($value);
-        }
-        return $value;
-    }
-
     /**
      * Returns the current value of this Form ViewHelper and converts it to an identifier string in case it's an object
      * The value is determined as follows:
@@ -251,7 +212,7 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
      */
     protected function hasMappingErrorOccurred()
     {
-        return $this->getRequest()->getOriginalRequest() !== null;
+        return $this->renderingContext->getControllerContext()->getRequest()->getOriginalRequest() !== null;
     }
 
     /**
@@ -264,7 +225,7 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
     {
         $propertyPath = rtrim(preg_replace('/(\\]\\[|\\[|\\])/', '.', $this->getNameWithoutPrefix()), '.');
         $value = ObjectAccess::getPropertyPath(
-            $this->controllerContext->getRequest()->getOriginalRequest()->getArguments(), $propertyPath
+            $this->renderingContext->getControllerContext()->getRequest()->getOriginalRequest()->getArguments(), $propertyPath
         );
         return $value;
     }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php
index 3c192fbf7f21..36562b80305e 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Abstract Form View Helper. Bundles functionality related to direct property access of objects in other Form ViewHelpers.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/ButtonViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/ButtonViewHelper.php
index 9f326d59b6d0..0eb9be294864 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/ButtonViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/ButtonViewHelper.php
@@ -1,16 +1,18 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script belongs to the FLOW3 package "TYPO3.Fluid".                *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Creates a button.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php
index 04f5ef945438..3741ec5152c6 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php
@@ -1,16 +1,18 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * View Helper which creates a simple checkbox (<input type="checkbox">).
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
index 2754bfd12ef5..ce8c4e46646c 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Renders an <input type="hidden" ...> tag.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/PasswordViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/PasswordViewHelper.php
index aebade30c96a..06117e5814c0 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/PasswordViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/PasswordViewHelper.php
@@ -1,16 +1,18 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * View Helper which creates a simple Password Text Box (<input type="password">).
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/RadioViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/RadioViewHelper.php
index 6b6910238d54..2e62d7a14944 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/RadioViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/RadioViewHelper.php
@@ -1,16 +1,18 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * View Helper which creates a simple radio button (<input type="radio">).
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php
index b876b58c71aa..a8ed221a40ba 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php
@@ -1,15 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This view helper generates a <select> dropdown list for the use with a form.
  *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php
index 7157fde9a0a1..3371688838c6 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php
@@ -1,16 +1,18 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Creates a submit button.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextareaViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextareaViewHelper.php
index ce1b1bb3a65e..cb5dd2025be3 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextareaViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextareaViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Textarea view helper.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php
index 3636fa920db8..c7c86fee223c 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * View Helper which creates a text field (<input type="text">).
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/UploadViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
index ba77acf87212..a9da35741a56 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A view helper which generates an <input type="file"> HTML element.
  * Make sure to set enctype="multipart/form-data" on the form!
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php
index 1d8261f9c5ca..e7f2c184e99a 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Validation results view helper
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
index 434ff979599e..94ae8be2652e 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License as published by the Free   *
- * Software Foundation, either version 3 of the License, or (at your      *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        *
- * You should have received a copy of the GNU General Public License      *
- * along with the script.                                                 *
- * If not, see http://www.gnu.org/licenses/gpl.html                       *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * Form view helper. Generates a <form> Tag.
  *
@@ -168,7 +162,7 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
         if ($this->hasArgument('actionUri')) {
             $formActionUri = $this->arguments['actionUri'];
         } else {
-            $uriBuilder = $this->controllerContext->getUriBuilder();
+            $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
             $formActionUri = $uriBuilder->reset()->setTargetPageUid($this->arguments['pageUid'])->setTargetPageType($this->arguments['pageType'])->setNoCache($this->arguments['noCache'])->setUseCacheHash(!$this->arguments['noCacheHash'])->setSection($this->arguments['section'])->setCreateAbsoluteUri($this->arguments['absolute'])->setArguments((array)$this->arguments['additionalParams'])->setAddQueryString($this->arguments['addQueryString'])->setArgumentsToBeExcludedFromQueryString((array)$this->arguments['argumentsToBeExcludedFromQueryString'])->setFormat($this->arguments['format'])->uriFor($this->arguments['action'], $this->arguments['arguments'], $this->arguments['controller'], $this->arguments['extensionName'], $this->arguments['pluginName']);
             $this->formActionUriArguments = $uriBuilder->getArguments();
         }
@@ -203,7 +197,7 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
      */
     protected function renderHiddenReferrerFields()
     {
-        $request = $this->controllerContext->getRequest();
+        $request = $this->renderingContext->getControllerContext()->getRequest();
         $extensionName = $request->getControllerExtensionName();
         $vendorName = $request->getControllerVendorName();
         $controllerName = $request->getControllerName();
@@ -364,15 +358,14 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
      */
     protected function postProcessUriArgumentsForRequestHash($arguments, &$results, $currentPrefix = '', $level = 0)
     {
-        if (!count($arguments)) {
-            return;
-        }
-        foreach ($arguments as $argumentName => $argumentValue) {
-            if (is_array($argumentValue)) {
-                $prefix = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']';
-                $this->postProcessUriArgumentsForRequestHash($argumentValue, $results, $prefix, $level + 1);
-            } else {
-                $results[] = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']';
+        if (count($arguments)) {
+            foreach ($arguments as $argumentName => $argumentValue) {
+                if (is_array($argumentValue)) {
+                    $prefix = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']';
+                    $this->postProcessUriArgumentsForRequestHash($argumentValue, $results, $prefix, $level + 1);
+                } else {
+                    $results[] = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']';
+                }
             }
         }
     }
@@ -384,7 +377,7 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
      */
     protected function getDefaultFieldNamePrefix()
     {
-        $request = $this->controllerContext->getRequest();
+        $request = $this->renderingContext->getControllerContext()->getRequest();
         if ($this->hasArgument('extensionName')) {
             $extensionName = $this->arguments['extensionName'];
         } else {
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/AbstractEncodingViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/AbstractEncodingViewHelper.php
index a0a392517f0a..4c8796b1cbfc 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/AbstractEncodingViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/AbstractEncodingViewHelper.php
@@ -1,18 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This is the base class for ViewHelpers that work with encodings.
  * Currently that are format.htmlentities, format.htmlentitiesDecode and format.htmlspecialchars
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/BytesViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/BytesViewHelper.php
index f9a8a94d935e..63c5b757159c 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/BytesViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/BytesViewHelper.php
@@ -1,21 +1,23 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Formats an integer with a byte count into human-readable form.
@@ -40,7 +42,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class BytesViewHelper extends AbstractViewHelper implements CompilableInterface
+class BytesViewHelper extends AbstractViewHelper
 {
     /**
      * @var array
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
index 1df934817d2a..41e062bdeb1f 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CaseViewHelper.php
@@ -1,22 +1,24 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Charset\CharsetConverter;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Modifies the case of an input string to upper- or lowercase or capitalization.
@@ -62,7 +64,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class CaseViewHelper extends AbstractViewHelper implements CompilableInterface
+class CaseViewHelper extends AbstractViewHelper
 {
     /**
      * Directs the input string being converted to "lowercase"
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CdataViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CdataViewHelper.php
deleted file mode 100644
index 614f158d664d..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CdataViewHelper.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Outputs an argument/value without any escaping and wraps it with CDATA tags.
- *
- * PAY SPECIAL ATTENTION TO SECURITY HERE (especially Cross Site Scripting),
- * as the output is NOT SANITIZED!
- *
- * = Examples =
- *
- * <code title="Child nodes">
- * <f:format.cdata>{string}</f:format.cdata>
- * </code>
- * <output>
- * <![CDATA[(Content of {string} without any conversion/escaping)]]>
- * </output>
- *
- * <code title="Value attribute">
- * <f:format.cdata value="{string}" />
- * </code>
- * <output>
- * <![CDATA[(Content of {string} without any conversion/escaping)]]>
- * </output>
- *
- * <code title="Inline notation">
- * {string -> f:format.cdata()}
- * </code>
- * <output>
- * <![CDATA[(Content of {string} without any conversion/escaping)]]>
- * </output>
- *
- * @api
- */
-class CdataViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = false;
-
-    /**
-     * @param mixed $value The value to output
-     * @return string
-     */
-    public function render($value = null)
-    {
-        return static::renderStatic(
-            array('value' => $value),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * @param array $arguments
-     * @param callable $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $arguments['value'];
-        if ($value === null) {
-            $value = $renderChildrenClosure();
-        }
-        return sprintf('<![CDATA[%s]]>', $value);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php
index 58ac0922dd38..12cddbf0c7a1 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php
@@ -1,24 +1,23 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Charset\CharsetConverter;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 
 /**
@@ -62,7 +61,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
  * (depending on the value of {someLongText})
  * </output>
  */
-class CropViewHelper extends AbstractViewHelper implements CompilableInterface
+class CropViewHelper extends AbstractViewHelper
 {
     /**
      * @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController contains a backup of the current $GLOBALS['TSFE'] if used in BE mode
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CurrencyViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CurrencyViewHelper.php
index 96496d2a14c5..93732c178ef4 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/CurrencyViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/CurrencyViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Formats a given float to a currency representation.
@@ -44,7 +46,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class CurrencyViewHelper extends AbstractViewHelper implements CompilableInterface
+class CurrencyViewHelper extends AbstractViewHelper
 {
     /**
      * @param string $currencySign (optional) The currency sign, eg $ or €.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php
index d6329b047e67..eb13c2f24b01 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php
@@ -1,21 +1,23 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Formats an object implementing \DateTimeInterface.
@@ -80,12 +82,17 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class DateViewHelper extends AbstractViewHelper implements CompilableInterface
+class DateViewHelper extends AbstractViewHelper
 {
     /**
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
 
     /**
      * Render the supplied DateTime object as a formatted date.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php
index 77b0b240b6c1..687ea01c43e4 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php
@@ -1,25 +1,24 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 
 /**
@@ -53,7 +52,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
  *
  * @see https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Parsefunc/
  */
-class HtmlViewHelper extends AbstractViewHelper implements CompilableInterface
+class HtmlViewHelper extends AbstractViewHelper
 {
     /**
      * @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController contains a backup of the current $GLOBALS['TSFE'] if used in BE mode
@@ -61,13 +60,14 @@ class HtmlViewHelper extends AbstractViewHelper implements CompilableInterface
     protected static $tsfeBackup;
 
     /**
-     * If the escaping interceptor should be disabled inside this ViewHelper, then set this value to FALSE.
-     * This is internal and NO part of the API. It is very likely to change.
-     *
      * @var bool
-     * @internal
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeChildren = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
 
     /**
      * @param string $parseFuncTSPath path to TypoScript parseFunc setup.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesDecodeViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesDecodeViewHelper.php
index 5b37f1275746..1d1933b35596 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesDecodeViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesDecodeViewHelper.php
@@ -1,18 +1,20 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Applies html_entity_decode() to a value
@@ -36,15 +38,12 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class HtmlentitiesDecodeViewHelper extends AbstractEncodingViewHelper implements CompilableInterface
+class HtmlentitiesDecodeViewHelper extends AbstractEncodingViewHelper
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
 
     /**
      * Converts all HTML entities to their applicable characters as needed using PHPs html_entity_decode() function.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesViewHelper.php
index 5b37641280e7..e4df5cbc0884 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesViewHelper.php
@@ -1,15 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 use TYPO3\CMS\Core\SingletonInterface;
 
 /**
@@ -37,12 +41,14 @@ use TYPO3\CMS\Core\SingletonInterface;
 class HtmlentitiesViewHelper extends AbstractEncodingViewHelper implements SingletonInterface
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
 
     /**
      * Escapes special characters with their escaped counterparts as needed using PHPs htmlentities() function.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlspecialcharsViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlspecialcharsViewHelper.php
deleted file mode 100644
index 52c4916c2cb6..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlspecialcharsViewHelper.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Applies htmlspecialchars() escaping to a value
- * @see http://www.php.net/manual/function.htmlspecialchars.php
- *
- * = Examples =
- *
- * <code title="default notation">
- * <f:format.htmlspecialchars>{text}</f:format.htmlspecialchars>
- * </code>
- * <output>
- * Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
- * </output>
- *
- * <code title="inline notation">
- * {text -> f:format.htmlspecialchars(encoding: 'ISO-8859-1')}
- * </code>
- * <output>
- * Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
- * </output>
- *
- * @api
- */
-class HtmlspecialcharsViewHelper extends AbstractEncodingViewHelper implements CompilableInterface
-{
-    /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = false;
-
-    /**
-     * Escapes special characters with their escaped counterparts as needed using PHPs htmlspecialchars() function.
-     *
-     * @param string $value string to format
-     * @param bool $keepQuotes if TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
-     * @param string $encoding
-     * @param bool $doubleEncode If FALSE existing html entities won't be encoded, the default is to convert everything.
-     * @return string the altered string
-     * @see http://www.php.net/manual/function.htmlspecialchars.php
-     * @api
-     */
-    public function render($value = null, $keepQuotes = false, $encoding = null, $doubleEncode = true)
-    {
-        if ($value === null) {
-            $value = $this->renderChildren();
-        }
-        if (!is_string($value)) {
-            return $value;
-        }
-        if ($encoding === null) {
-            $encoding = self::resolveDefaultEncoding();
-        }
-        $flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
-        return htmlspecialchars($value, $flags, $encoding, $doubleEncode);
-    }
-
-    /**
-     * This ViewHelper is used a *lot* because it is used by the escape interceptor.
-     * Therefore we render it to raw PHP code during compilation
-     *
-     * @param string $argumentsVariableName
-     * @param string $renderChildrenClosureVariableName
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
-    {
-        $valueVariableName = $templateCompiler->variableName('value');
-        $initializationPhpCode .= sprintf('%s = (%s[\'value\'] !== NULL ? %s[\'value\'] : %s());', $valueVariableName, $argumentsVariableName, $argumentsVariableName, $renderChildrenClosureVariableName) . LF;
-
-        return sprintf('(!is_string(%s) ? %s : htmlspecialchars(%s, (%s[\'keepQuotes\'] ? ENT_NOQUOTES : ENT_COMPAT), (%s[\'encoding\'] !== NULL ? %s[\'encoding\'] : \\TYPO3\\CMS\\Fluid\\Core\\Compiler\\AbstractCompiledTemplate::resolveDefaultEncoding()), %s[\'doubleEncode\']))',
-                $valueVariableName, $valueVariableName, $valueVariableName, $argumentsVariableName, $argumentsVariableName, $argumentsVariableName, $argumentsVariableName);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
index 5ce900233c9f..d0693164bb2b 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/Nl2brViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Wrapper for PHPs nl2br function.
@@ -37,7 +39,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class Nl2brViewHelper extends AbstractViewHelper implements CompilableInterface
+class Nl2brViewHelper extends AbstractViewHelper
 {
     /**
      * Replaces newline characters by HTML line breaks.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
index d9d1b6590d67..6300abdabc42 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/NumberViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Formats a number with custom precision, decimal point and grouped thousands.
@@ -38,7 +40,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class NumberViewHelper extends AbstractViewHelper implements CompilableInterface
+class NumberViewHelper extends AbstractViewHelper
 {
     /**
      * Format the numeric value as a number with grouped thousands, decimal point and
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/PaddingViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/PaddingViewHelper.php
index 8f988a97c0fc..ce1aae90737d 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/PaddingViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/PaddingViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Formats a string using PHPs str_pad function.
@@ -44,7 +46,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class PaddingViewHelper extends AbstractViewHelper implements CompilableInterface
+class PaddingViewHelper extends AbstractViewHelper
 {
     /**
      * Pad a string to a certain length with another string
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/PrintfViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/PrintfViewHelper.php
deleted file mode 100644
index 532207ae5857..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/PrintfViewHelper.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * A view helper for formatting values with printf. Either supply an array for
- * the arguments or a single value.
- * See http://www.php.net/manual/en/function.sprintf.php
- *
- * = Examples =
- *
- * <code title="Scientific notation">
- * <f:format.printf arguments="{number: 362525200}">%.3e</f:format.printf>
- * </code>
- * <output>
- * 3.625e+8
- * </output>
- *
- * <code title="Argument swapping">
- * <f:format.printf arguments="{0: 3, 1: 'Kasper'}">%2$s is great, TYPO%1$d too. Yes, TYPO%1$d is great and so is %2$s!</f:format.printf>
- * </code>
- * <output>
- * Kasper is great, TYPO3 too. Yes, TYPO3 is great and so is Kasper!
- * </output>
- *
- * <code title="Single argument">
- * <f:format.printf arguments="{1: 'TYPO3'}">We love %s</f:format.printf>
- * </code>
- * <output>
- * We love TYPO3
- * </output>
- *
- * <code title="Inline notation">
- * {someText -> f:format.printf(arguments: {1: 'TYPO3'})}
- * </code>
- * <output>
- * We love TYPO3
- * </output>
- *
- * @api
- */
-class PrintfViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Format the arguments with the given printf format string.
-     *
-     * @param array $arguments The arguments for vsprintf
-     * @param string $value string to format
-     * @return string The formatted value
-     * @api
-     */
-    public function render(array $arguments, $value = null)
-    {
-        return static::renderStatic(
-            array(
-                'arguments' => $arguments,
-                'value' => $value
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Applies vsprintf() on the specified value.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $arguments['value'];
-        if ($value === null) {
-            $value = $renderChildrenClosure();
-        }
-
-        return vsprintf($value, $arguments['arguments']);
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/RawViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/RawViewHelper.php
deleted file mode 100644
index 3242a603a3f1..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/RawViewHelper.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Outputs an argument/value without any escaping. Is normally used to output
- * an ObjectAccessor which should not be escaped, but output as-is.
- *
- * PAY SPECIAL ATTENTION TO SECURITY HERE (especially Cross Site Scripting),
- * as the output is NOT SANITIZED!
- *
- * = Examples =
- *
- * <code title="Child nodes">
- * <f:format.raw>{string}</f:format.raw>
- * </code>
- * <output>
- * (Content of {string} without any conversion/escaping)
- * </output>
- *
- * <code title="Value attribute">
- * <f:format.raw value="{string}" />
- * </code>
- * <output>
- * (Content of {string} without any conversion/escaping)
- * </output>
- *
- * <code title="Inline notation">
- * {string -> f:format.raw()}
- * </code>
- * <output>
- * (Content of {string} without any conversion/escaping)
- * </output>
- *
- * @api
- */
-class RawViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
-     * @var bool
-     */
-    protected $escapingInterceptorEnabled = false;
-
-    /**
-     * @param mixed $value The value to output
-     * @return string
-     */
-    public function render($value = null)
-    {
-        return static::renderStatic(
-            array(
-                'value' => $value
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Render children without escaping
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $value = $arguments['value'];
-        if ($value === null) {
-            return $renderChildrenClosure();
-        } else {
-            return $value;
-        }
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
index 6b23b4c4493f..81d29a3cda2e 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Removes tags from the given string (applying PHPs strip_tags() function)
@@ -38,15 +40,17 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class StripTagsViewHelper extends AbstractViewHelper implements CompilableInterface
+class StripTagsViewHelper extends AbstractViewHelper
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
 
     /**
      * Escapes special characters with their escaped counterparts as needed using PHPs strip_tags() function.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
index a9c94b0bd8c1..d850c9f44318 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Format/UrlencodeViewHelper.php
@@ -1,19 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Encodes the given string according to http://www.faqs.org/rfcs/rfc3986.html (applying PHPs rawurlencode() function)
@@ -37,15 +39,17 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class UrlencodeViewHelper extends AbstractViewHelper implements CompilableInterface
+class UrlencodeViewHelper extends AbstractViewHelper
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
 
     /**
      * Escapes special characters with their escaped counterparts as needed using PHPs rawurlencode() function.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/GroupedForViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/GroupedForViewHelper.php
deleted file mode 100644
index 76d627291782..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/GroupedForViewHelper.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Grouped loop view helper.
- * Loops through the specified values.
- *
- * The groupBy argument also supports property paths.
- *
- * = Examples =
- *
- * <code title="Simple">
- * <f:groupedFor each="{0: {name: 'apple', color: 'green'}, 1: {name: 'cherry', color: 'red'}, 2: {name: 'banana', color: 'yellow'}, 3: {name: 'strawberry', color: 'red'}}" as="fruitsOfThisColor" groupBy="color">
- *   <f:for each="{fruitsOfThisColor}" as="fruit">
- *     {fruit.name}
- *   </f:for>
- * </f:groupedFor>
- * </code>
- * <output>
- * apple cherry strawberry banana
- * </output>
- *
- * <code title="Two dimensional list">
- * <ul>
- *   <f:groupedFor each="{0: {name: 'apple', color: 'green'}, 1: {name: 'cherry', color: 'red'}, 2: {name: 'banana', color: 'yellow'}, 3: {name: 'strawberry', color: 'red'}}" as="fruitsOfThisColor" groupBy="color" groupKey="color">
- *     <li>
- *       {color} fruits:
- *       <ul>
- *         <f:for each="{fruitsOfThisColor}" as="fruit" key="label">
- *           <li>{label}: {fruit.name}</li>
- *         </f:for>
- *       </ul>
- *     </li>
- *   </f:groupedFor>
- * </ul>
- * </code>
- * <output>
- * <ul>
- *   <li>green fruits
- *     <ul>
- *       <li>0: apple</li>
- *     </ul>
- *   </li>
- *   <li>red fruits
- *     <ul>
- *       <li>1: cherry</li>
- *     </ul>
- *     <ul>
- *       <li>3: strawberry</li>
- *     </ul>
- *   </li>
- *   <li>yellow fruits
- *     <ul>
- *       <li>2: banana</li>
- *     </ul>
- *   </li>
- * </ul>
- * </output>
- *
- * @api
- */
-class GroupedForViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
-{
-    /**
-     * Iterates through elements of $each and renders child nodes
-     *
-     * @param array $each The array or \TYPO3\CMS\Extbase\Persistence\ObjectStorage to iterated over
-     * @param string $as The name of the iteration variable
-     * @param string $groupBy Group by this property
-     * @param string $groupKey The name of the variable to store the current group
-     * @return string Rendered string
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     * @api
-     */
-    public function render($each, $as, $groupBy, $groupKey = 'groupKey')
-    {
-        $output = '';
-        if ($each === null) {
-            return '';
-        }
-        if (is_object($each)) {
-            if (!$each instanceof \Traversable) {
-                throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('GroupedForViewHelper only supports arrays and objects implementing \Traversable interface', 1253108907);
-            }
-            $each = iterator_to_array($each);
-        }
-
-        $groups = $this->groupElements($each, $groupBy);
-
-        foreach ($groups['values'] as $currentGroupIndex => $group) {
-            $this->templateVariableContainer->add($groupKey, $groups['keys'][$currentGroupIndex]);
-            $this->templateVariableContainer->add($as, $group);
-            $output .= $this->renderChildren();
-            $this->templateVariableContainer->remove($groupKey);
-            $this->templateVariableContainer->remove($as);
-        }
-        return $output;
-    }
-
-    /**
-     * Groups the given array by the specified groupBy property.
-     *
-     * @param array $elements The array / traversable object to be grouped
-     * @param string $groupBy Group by this property
-     * @return array The grouped array in the form array('keys' => array('key1' => [key1value], 'key2' => [key2value], ...), 'values' => array('key1' => array([key1value] => [element1]), ...), ...)
-     * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    protected function groupElements(array $elements, $groupBy)
-    {
-        $groups = array('keys' => array(), 'values' => array());
-        foreach ($elements as $key => $value) {
-            if (is_array($value)) {
-                $currentGroupIndex = isset($value[$groupBy]) ? $value[$groupBy] : null;
-            } elseif (is_object($value)) {
-                $currentGroupIndex = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath($value, $groupBy);
-            } else {
-                throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('GroupedForViewHelper only supports multi-dimensional arrays and objects', 1253120365);
-            }
-            $currentGroupKeyValue = $currentGroupIndex;
-            if (is_object($currentGroupIndex)) {
-                if ($currentGroupIndex instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
-                    $currentGroupIndex = $currentGroupIndex->_loadRealInstance();
-                }
-                $currentGroupIndex = spl_object_hash($currentGroupIndex);
-            }
-            $groups['keys'][$currentGroupIndex] = $currentGroupKeyValue;
-            $groups['values'][$currentGroupIndex][$key] = $value;
-        }
-        return $groups;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/IfViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/IfViewHelper.php
deleted file mode 100644
index 140040376085..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/IfViewHelper.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * This view helper implements an if/else condition.
- * Check \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::convertArgumentValue() to see how boolean arguments are evaluated
- *
- * **Conditions:**
- *
- * As a condition is a boolean value, you can just use a boolean argument.
- * Alternatively, you can write a boolean expression there.
- * Boolean expressions have the following form:
- * XX Comparator YY
- * Comparator is one of: ==, !=, <, <=, >, >= and %
- * The % operator converts the result of the % operation to boolean.
- *
- * XX and YY can be one of:
- * - number
- * - Object Accessor
- * - Array
- * - a ViewHelper
- * - a String
- *
- *   <f:if condition="{rank} > 100">
- *     Will be shown if rank is > 100
- *   </f:if>
- *   <f:if condition="{rank} % 2">
- *     Will be shown if rank % 2 != 0.
- *   </f:if>
- *   <f:if condition="{rank} == {k:bar()}">
- *     Checks if rank is equal to the result of the ViewHelper "k:bar"
- *   </f:if>
- *   <f:if condition="{foo.bar} == 'stringToCompare'">
- *     Will result true if {foo.bar}'s represented value equals 'stringToCompare'.
- *   </f:if>
- *
- * = Examples =
- *
- * <code title="Basic usage">
- * <f:if condition="somecondition">
- *   This is being shown in case the condition matches
- * </f:if>
- * </code>
- * <output>
- * Everything inside the <f:if> tag is being displayed if the condition evaluates to TRUE.
- * </output>
- *
- * <code title="If / then / else">
- * <f:if condition="somecondition">
- *   <f:then>
- *     This is being shown in case the condition matches.
- *   </f:then>
- *   <f:else>
- *     This is being displayed in case the condition evaluates to FALSE.
- *   </f:else>
- * </f:if>
- * </code>
- * <output>
- * Everything inside the "then" tag is displayed if the condition evaluates to TRUE.
- * Otherwise, everything inside the "else"-tag is displayed.
- * </output>
- *
- * <code title="inline notation">
- * {f:if(condition: someCondition, then: 'condition is met', else: 'condition is not met')}
- * </code>
- * <output>
- * The value of the "then" attribute is displayed if the condition evaluates to TRUE.
- * Otherwise, everything the value of the "else"-attribute is displayed.
- * </output>
- *
- * @see \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::convertArgumentValue()
- * @api
- */
-class IfViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper
-{
-    /**
-     * @return void
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('condition', 'boolean', 'Condition to be evaluated.');
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/LayoutViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/LayoutViewHelper.php
deleted file mode 100644
index 227e6d5dcc6b..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/LayoutViewHelper.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * With this tag, you can select a layout to be used for the current template.
- *
- * = Examples =
- *
- * <code>
- * <f:layout name="main" />
- * </code>
- * <output>
- * (no output)
- * </output>
- *
- * @api
- */
-class LayoutViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\PostParseInterface
-{
-    /**
-     * Initialize arguments
-     *
-     * @return void
-     * @api
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('name', 'string', 'Name of layout to use. If none given, "Default" is used.', true);
-    }
-
-    /**
-     * On the post parse event, add the "layoutName" variable to the variable container so it can be used by the TemplateView.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode
-     * @param array $viewHelperArguments
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer
-     * @return void
-     */
-    public static function postParseEvent(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode, array $viewHelperArguments, \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer)
-    {
-        if (isset($viewHelperArguments['name'])) {
-            $layoutNameNode = $viewHelperArguments['name'];
-        } else {
-            $layoutNameNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('Default');
-        }
-
-        $variableContainer->add('layoutName', $layoutNameNode);
-    }
-
-    /**
-     * This tag will not be rendered at all.
-     *
-     * @return void
-     * @api
-     */
-    public function render()
-    {
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php
index fabca125e767..25211408e3e2 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php
@@ -1,18 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A view helper for creating links to extbase actions.
  *
@@ -40,6 +41,7 @@ class ActionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBased
      */
     public function initializeArguments()
     {
+        parent::initializeArguments();
         $this->registerUniversalTagAttributes();
         $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');
         $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document');
@@ -69,7 +71,7 @@ class ActionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBased
      */
     public function render($action = null, array $arguments = array(), $controller = null, $extensionName = null, $pluginName = null, $pageUid = null, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = array(), $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = null)
     {
-        $uriBuilder = $this->controllerContext->getUriBuilder();
+        $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
         $uri = $uriBuilder->reset()->setTargetPageUid($pageUid)->setTargetPageType($pageType)->setNoCache($noCache)->setUseCacheHash(!$noCacheHash)->setSection($section)->setFormat($format)->setLinkAccessRestrictedPages($linkAccessRestrictedPages)->setArguments($additionalParams)->setCreateAbsoluteUri($absolute)->setAddQueryString($addQueryString)->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)->setAddQueryStringMethod($addQueryStringMethod)->uriFor($action, $arguments, $controller, $extensionName, $pluginName);
         $this->tag->addAttribute('href', $uri);
         $this->tag->setContent($this->renderChildren());
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/EmailViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/EmailViewHelper.php
index 7701fc190970..ff9c46fe3666 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/EmailViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/EmailViewHelper.php
@@ -1,18 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * Email link view helper.
  * Generates an email link incorporating TYPO3s spamProtectEmailAddresses-settings.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ExternalViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ExternalViewHelper.php
index da9e1d981995..fdbb55d8180b 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ExternalViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ExternalViewHelper.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * A view helper for creating links to external targets.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php
index c237c7e00c97..f3fba59247b7 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php
@@ -1,18 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A view helper for creating links to TYPO3 pages.
  *
@@ -77,7 +78,7 @@ class PageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
      */
     public function render($pageUid = null, array $additionalParams = array(), $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $linkAccessRestrictedPages = false, $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = null)
     {
-        $uriBuilder = $this->controllerContext->getUriBuilder();
+        $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
         $uri = $uriBuilder->reset()
             ->setTargetPageUid($pageUid)
             ->setTargetPageType($pageType)
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
index d4e77d55160d..51b57b22d1e5 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
@@ -1,23 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
 
@@ -51,7 +49,7 @@ use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
  * </output>
  *
  */
-class TypolinkViewHelper extends AbstractViewHelper implements CompilableInterface
+class TypolinkViewHelper extends AbstractViewHelper
 {
     /**
      * Render
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php
index f967a096db81..09da4e567562 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Fluid\ViewHelpers;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Core\Resource\FileInterface;
 use TYPO3\CMS\Core\Resource\FileReference;
 use TYPO3\CMS\Core\Resource\Rendering\RendererRegistry;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/RenderChildrenViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/RenderChildrenViewHelper.php
index a0f4852000bb..24c7128bf088 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/RenderChildrenViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/RenderChildrenViewHelper.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * Render the inner parts of a Widget.
  * This ViewHelper can only be used in a template which belongs to a Widget Controller.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php
deleted file mode 100644
index 79c7f79a93cc..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * ViewHelper that renders a section or a specified partial
- *
- * == Examples ==
- *
- * <code title="Rendering partials">
- * <f:render partial="SomePartial" arguments="{foo: someVariable}" />
- * </code>
- * <output>
- * the content of the partial "SomePartial". The content of the variable {someVariable} will be available in the partial as {foo}
- * </output>
- *
- * <code title="Rendering sections">
- * <f:section name="someSection">This is a section. {foo}</f:section>
- * <f:render section="someSection" arguments="{foo: someVariable}" />
- * </code>
- * <output>
- * the content of the section "someSection". The content of the variable {someVariable} will be available in the partial as {foo}
- * </output>
- *
- * <code title="Rendering recursive sections">
- * <f:section name="mySection">
- *  <ul>
- *    <f:for each="{myMenu}" as="menuItem">
- *      <li>
- *        {menuItem.text}
- *        <f:if condition="{menuItem.subItems}">
- *          <f:render section="mySection" arguments="{myMenu: menuItem.subItems}" />
- *        </f:if>
- *      </li>
- *    </f:for>
- *  </ul>
- * </f:section>
- * <f:render section="mySection" arguments="{myMenu: menu}" />
- * </code>
- * <output>
- * <ul>
- *   <li>menu1
- *     <ul>
- *       <li>menu1a</li>
- *       <li>menu1b</li>
- *     </ul>
- *   </li>
- * [...]
- * (depending on the value of {menu})
- * </output>
- *
- *
- * <code title="Passing all variables to a partial">
- * <f:render partial="somePartial" arguments="{_all}" />
- * </code>
- * <output>
- * the content of the partial "somePartial".
- * Using the reserved keyword "_all", all available variables will be passed along to the partial
- * </output>
- *
- * @api
- */
-class RenderViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Renders the content.
-     *
-     * @param string $section Name of section to render. If used in a layout, renders a section of the main content file. If used inside a standard template, renders a section of the same file.
-     * @param string $partial Reference to a partial.
-     * @param array $arguments Arguments to pass to the partial.
-     * @param bool $optional Set to TRUE, to ignore unknown sections, so the definition of a section inside a template can be optional for a layout
-     * @return string
-     * @api
-     */
-    public function render($section = null, $partial = null, $arguments = array(), $optional = false)
-    {
-        return static::renderStatic(
-            array(
-                'section' => $section,
-                'partial' => $partial,
-                'arguments' => $arguments,
-                'optional' => $optional,
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Renders the content.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $section = $arguments['section'];
-        $partial = $arguments['partial'];
-        $optional = $arguments['optional'];
-        $arguments = static::loadSettingsIntoArguments($arguments['arguments'], $renderingContext);
-
-        $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
-        if ($partial !== null) {
-            return $viewHelperVariableContainer->getView()->renderPartial($partial, $section, $arguments);
-        } elseif ($section !== null) {
-            return $viewHelperVariableContainer->getView()->renderSection($section, $arguments, $optional);
-        }
-
-        return '';
-    }
-
-    /**
-     * If $arguments['settings'] is not set, it is loaded from the TemplateVariableContainer (if it is available there).
-     *
-     * @param array $arguments
-     * @param RenderingContextInterface $renderingContext
-     * @return array
-     */
-    protected static function loadSettingsIntoArguments($arguments, RenderingContextInterface $renderingContext)
-    {
-        $templateVariableContainer = $renderingContext->getTemplateVariableContainer();
-        if (!isset($arguments['settings']) && $templateVariableContainer->exists('settings')) {
-            $arguments['settings'] = $templateVariableContainer->get('settings');
-        }
-        return $arguments;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/SectionViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/SectionViewHelper.php
deleted file mode 100644
index e7a745281e35..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/SectionViewHelper.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A Section view helper
- *
- * == Examples ==
- *
- * <code title="Rendering sections">
- * <f:section name="someSection">This is a section. {foo}</f:section>
- * <f:render section="someSection" arguments="{foo: someVariable}" />
- * </code>
- * <output>
- * the content of the section "someSection". The content of the variable {someVariable} will be available in the partial as {foo}
- * </output>
- *
- * <code title="Rendering recursive sections">
- * <f:section name="mySection">
- *  <ul>
- *    <f:for each="{myMenu}" as="menuItem">
- *      <li>
- *        {menuItem.text}
- *        <f:if condition="{menuItem.subItems}">
- *          <f:render section="mySection" arguments="{myMenu: menuItem.subItems}" />
- *        </f:if>
- *      </li>
- *    </f:for>
- *  </ul>
- * </f:section>
- * <f:render section="mySection" arguments="{myMenu: menu}" />
- * </code>
- * <output>
- * <ul>
- *   <li>menu1
- *     <ul>
- *       <li>menu1a</li>
- *       <li>menu1b</li>
- *     </ul>
- *   </li>
- * [...]
- * (depending on the value of {menu})
- * </output>
- *
- * @api
- */
-class SectionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\PostParseInterface, \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-{
-    /**
-     * Initialize the arguments.
-     *
-     * @return void
-     * @api
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('name', 'string', 'Name of the section', true);
-    }
-
-    /**
-     * Save the associated view helper node in a static public class variable.
-     * called directly after the view helper was built.
-     *
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode
-     * @param array $viewHelperArguments
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer
-     * @return void
-     */
-    public static function postParseEvent(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $syntaxTreeNode, array $viewHelperArguments, \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer)
-    {
-        $sectionName = $viewHelperArguments['name']->getText();
-        if (!$variableContainer->exists('sections')) {
-            $variableContainer->add('sections', array());
-        }
-        $sections = $variableContainer->get('sections');
-        $sections[$sectionName] = $syntaxTreeNode;
-        $variableContainer->remove('sections');
-        $variableContainer->add('sections', $sections);
-    }
-
-    /**
-     * Rendering directly returns all child nodes.
-     *
-     * @return string HTML String of all child nodes.
-     * @api
-     */
-    public function render()
-    {
-        if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection')) {
-            $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection');
-            return $this->renderChildren();
-        }
-        return '';
-    }
-
-    /**
-     * The inner contents of a section should not be rendered.
-     *
-     * @param string $argumentsVariableName
-     * @param string $renderChildrenClosureVariableName
-     * @param string $initializationPhpCode
-     * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode
-     * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
-     * @return string
-     */
-    public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
-    {
-        return '\'\'';
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php
index 9663e7fcfe37..3710232d17a9 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Security;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This view helper implements an ifAuthenticated/else condition for FE users/groups.
  *
@@ -63,4 +57,16 @@ class IfAuthenticatedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abstrac
     {
         return isset($GLOBALS['TSFE']) && $GLOBALS['TSFE']->loginUser;
     }
+
+    /**
+     * @return mixed
+     */
+    public function render()
+    {
+        if (static::evaluateCondition($this->arguments)) {
+            return $this->renderThenChild();
+        } else {
+            return $this->renderElseChild();
+        }
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfHasRoleViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfHasRoleViewHelper.php
index ab0a277e725f..ef2bfa290a52 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfHasRoleViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfHasRoleViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Security;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * This view helper implements an ifHasRole/else condition for FE users/groups.
  *
@@ -92,4 +86,16 @@ class IfHasRoleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractCondi
             return is_array($GLOBALS['TSFE']->fe_user->groupData['title']) && in_array($role, $GLOBALS['TSFE']->fe_user->groupData['title']);
         }
     }
+
+    /**
+     * @return mixed
+     */
+    public function render()
+    {
+        if (static::evaluateCondition($this->arguments)) {
+            return $this->renderThenChild();
+        } else {
+            return $this->renderElseChild();
+        }
+    }
 }
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/SpacelessViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/SpacelessViewHelper.php
deleted file mode 100644
index 332fb040948e..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/SpacelessViewHelper.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Space Removal ViewHelper
- *
- * Removes redundant spaces between HTML tags while
- * preserving the whitespace that may be inside HTML
- * tags. Trims the final result before output.
- *
- * Heavily inspired by Twig's corresponding node type.
- *
- * <code title="Usage of f:spaceless">
- * <f:spaceless>
- * <div>
- *     <div>
- *         <div>text
- *
- * text</div>
- *     </div>
- * </div>
- * </code>
- * <output>
- * <div><div><div>text
- *
- * text</div></div></div>
- * </output>
- */
-class SpacelessViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * @return string
-     */
-    public function render()
-    {
-        return static::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
-    }
-
-    /**
-     * @param array $arguments
-     * @param \Closure $childClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $childClosure, RenderingContextInterface $renderingContext)
-    {
-        return trim(preg_replace('/\\>\\s+\\</', '><', $childClosure()));
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php
deleted file mode 100644
index a02e2d9ab53e..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Switch view helper which can be used to render content depending on a value or expression.
- * Implements what a basic switch()-PHP-method does.
- *
- * = Examples =
- *
- * <code title="Simple Switch statement">
- * <f:switch expression="{person.gender}">
- *   <f:case value="male">Mr.</f:case>
- *   <f:case value="female">Mrs.</f:case>
- *   <f:case default="TRUE">Mrs. or Mr.</f:case>
- * </f:switch>
- * </code>
- * <output>
- * Mr. / Mrs. (depending on the value of {person.gender}) or if no value evaluates to TRUE, default case
- * </output>
- *
- * Note: Using this view helper can be a sign of weak architecture. If you end up using it extensively
- * you might want to consider restructuring your controllers/actions and/or use partials and sections.
- * E.g. the above example could be achieved with <f:render partial="title.{person.gender}" /> and the partials
- * "title.male.html", "title.female.html", ...
- * Depending on the scenario this can be easier to extend and possibly contains less duplication.
- *
- * @api
- */
-class SwitchViewHelper extends AbstractViewHelper implements ChildNodeAccessInterface, CompilableInterface
-{
-    /**
-     * An array of \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
-     * @var array
-     */
-    private $childNodes = array();
-
-    /**
-     * @var mixed
-     */
-    protected $backupSwitchExpression = null;
-
-    /**
-     * @var bool
-     */
-    protected $backupBreakState = false;
-
-    /**
-     * Setter for ChildNodes - as defined in ChildNodeAccessInterface
-     *
-     * @param array $childNodes Child nodes of this syntax tree node
-     * @return void
-     */
-    public function setChildNodes(array $childNodes)
-    {
-        $this->childNodes = $childNodes;
-    }
-
-    /**
-     * @param mixed $expression
-     * @return string the rendered string
-     * @api
-     */
-    public function render($expression)
-    {
-        return static::renderStatic(
-            array(
-                'expression' => $expression
-            ),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Default implementation for CompilableInterface. See CompilableInterface
-     * for a detailed description of this method.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return mixed
-     * @see \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
-
-        $stackValue = array(
-            'expression' => $arguments['expression'],
-            'break' => false
-        );
-
-        if ($viewHelperVariableContainer->exists(SwitchViewHelper::class, 'stateStack')) {
-            $stateStack = $viewHelperVariableContainer->get(SwitchViewHelper::class, 'stateStack');
-        } else {
-            $stateStack = array();
-        }
-        $stateStack[] = $stackValue;
-        $viewHelperVariableContainer->addOrUpdate(SwitchViewHelper::class, 'stateStack', $stateStack);
-
-        $result = $renderChildrenClosure();
-
-        $stateStack = $viewHelperVariableContainer->get(SwitchViewHelper::class, 'stateStack');
-        array_pop($stateStack);
-        $viewHelperVariableContainer->addOrUpdate(SwitchViewHelper::class, 'stateStack', $stateStack);
-
-        return $result;
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/ThenViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/ThenViewHelper.php
deleted file mode 100644
index fb2e2c4fc458..000000000000
--- a/typo3/sysext/fluid/Classes/ViewHelpers/ThenViewHelper.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * "THEN" -> only has an effect inside of "IF". See If-ViewHelper for documentation.
- *
- * @see \TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper
- * @api
- */
-class ThenViewHelper extends AbstractViewHelper implements CompilableInterface
-{
-    /**
-     * Just render everything.
-     *
-     * @return string the rendered string
-     * @api
-     */
-    public function render()
-    {
-        return static::renderStatic(
-            array(),
-            $this->buildRenderChildrenClosure(),
-            $this->renderingContext
-        );
-    }
-
-    /**
-     * Render children
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        return $renderChildrenClosure();
-    }
-}
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php
index d3a6178b7744..8f96738544b7 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php
@@ -1,24 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Translate a key from locallang. The files are loaded from the folder
@@ -71,7 +69,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * value of id "key1" in the current website language
  * </output>
  */
-class TranslateViewHelper extends AbstractViewHelper implements CompilableInterface
+class TranslateViewHelper extends AbstractViewHelper
 {
     /**
      * Render translation
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php
index 95e3a82d69a7..940ce86edc04 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php
@@ -1,18 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A view helper for creating URIs to extbase actions.
  *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/EmailViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/EmailViewHelper.php
index 80941a5b6c54..e83751065ac4 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/EmailViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/EmailViewHelper.php
@@ -1,22 +1,20 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Email URI view helper.
@@ -32,7 +30,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * (depending on your spamProtectEmailAddresses-settings)
  * </output>
  */
-class EmailViewHelper extends AbstractViewHelper implements CompilableInterface
+class EmailViewHelper extends AbstractViewHelper
 {
     /**
      * @param string $email The email address to be turned into a URI
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ExternalViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ExternalViewHelper.php
index 13350d41281c..cc8fda8aba65 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ExternalViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ExternalViewHelper.php
@@ -1,19 +1,20 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * A view helper for creating URIs to external targets.
@@ -37,7 +38,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @api
  */
-class ExternalViewHelper extends AbstractViewHelper implements CompilableInterface
+class ExternalViewHelper extends AbstractViewHelper
 {
     /**
      * @param string $uri target URI
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php
index 8a74d745904f..4f8f7346c9d2 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php
@@ -24,7 +24,6 @@ use TYPO3\CMS\Extbase\Service\ImageService;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Resizes a given image (if required) and returns its relative path.
@@ -64,7 +63,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * Could not get image resource for "NonExistingImage.png".
  * </output>
  */
-class ImageViewHelper extends AbstractViewHelper implements CompilableInterface
+class ImageViewHelper extends AbstractViewHelper
 {
     /**
      * Resizes the image (if required) and returns its path. If the image was not resized, the path will be equal to $src
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/PageViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/PageViewHelper.php
index 4e7d7c968a78..ee8cf3345b40 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/PageViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/PageViewHelper.php
@@ -1,21 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * A view helper for creating URIs to TYPO3 pages.
@@ -46,7 +44,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * (depending on your TS configuration)
  * </output>
  */
-class PageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements CompilableInterface
+class PageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
      * @param int|NULL $pageUid target PID
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ResourceViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ResourceViewHelper.php
index d95210d4a510..1ced0d74c553 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ResourceViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ResourceViewHelper.php
@@ -1,22 +1,20 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * A view helper for creating URIs to resources.
@@ -31,7 +29,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * (depending on current package)
  * </output>
  */
-class ResourceViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements CompilableInterface
+class ResourceViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
      * Render the URI to the resource. The filename is used from child content.
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php
index 3652af662a0e..7db4e4c242a1 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php
@@ -1,23 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
 
@@ -46,7 +44,7 @@ use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
  * </output>
  *
  */
-class TypolinkViewHelper extends AbstractViewHelper implements CompilableInterface
+class TypolinkViewHelper extends AbstractViewHelper
 {
     /**
      * Render
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
index 8dac1c859cb9..43db952f9937 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * Simple paginate widget
  * Note: Make sure to include jQuery and jQuery UI in the HTML, like that:
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
index d1b0361eff87..7e5a2a32ead7 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
@@ -1,25 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
+/**
+ * Class AutocompleteController
+ */
 class AutocompleteController extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController
 {
     /**
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php
index 949548ae5f53..cfc62dcc5c00 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
 use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/LinkViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/LinkViewHelper.php
index 09fe28bd82e3..745313bf3e10 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/LinkViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/LinkViewHelper.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+
 /**
  * A view helper for creating Links to extbase actions within widets.
  *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php
index 73307cbd5b67..3c03c6dcd7ff 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
 use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
 use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper;
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php
index 2fab219dad27..6d703003dedd 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php
@@ -2,24 +2,18 @@
 namespace TYPO3\CMS\Fluid\ViewHelpers\Widget;
 
 /*
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+ * 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!
+ */
+
 /**
  * A view helper for creating URIs to extbase actions within widgets.
  *
diff --git a/typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php b/typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php
new file mode 100644
index 000000000000..c7aa16474e4f
--- /dev/null
+++ b/typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php
@@ -0,0 +1,27 @@
+<?php
+return array(
+    'TYPO3\\CMS\\Fluid\\Core\\Parser\\InterceptorInterface' => \TYPO3Fluid\Fluid\Core\Parser\InterceptorInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface' => \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\NodeInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface' => \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperInterface' => \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Facets\\ChildNodeAccessInterface' => \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Facets\\CompilableInterface' => \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Facets\\PostParseInterface' => \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface::class,
+
+    // Fluid-specific errors
+    'TYPO3\\CMS\\Fluid\\Core\\Exception' => \TYPO3Fluid\Fluid\Core\Exception::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Exception' => \TYPO3Fluid\Fluid\Core\ViewHelper\Exception::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Exception\\InvalidVariableException' => \TYPO3Fluid\Fluid\Core\Exception::class,
+    'TYPO3\\CMS\\Fluid\\View\\Exception' => \TYPO3Fluid\Fluid\View\Exception::class,
+    'TYPO3\\CMS\\Fluid\\View\\Exception\\InvalidSectionException' => \TYPO3Fluid\Fluid\View\Exception\InvalidSectionException::class,
+    'TYPO3\\CMS\\Fluid\\View\\Exception\\InvalidTemplateResourceException' => \TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException::class,
+
+    // Fluid variable containers, ViewHelpers, interfaces
+    'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode' => \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode::class,
+    'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode' => \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer' => \TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider::class,
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer' => \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class,
+
+    // Semi API level classes; mainly used in unit tests
+    'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder' => \TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder::class
+);
diff --git a/typo3/sysext/fluid/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/fluid/Migrations/Code/LegacyClassesForIde.php
new file mode 100644
index 000000000000..272415c30522
--- /dev/null
+++ b/typo3/sysext/fluid/Migrations/Code/LegacyClassesForIde.php
@@ -0,0 +1,96 @@
+<?php
+namespace {
+    die('Access denied');
+}
+
+namespace TYPO3\CMS\Fluid\Core\Parser {
+    interface InterceptorInterface extends \TYPO3Fluid\Fluid\Core\Parser\InterceptorInterface
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree {
+    interface NodeInterface extends \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\NodeInterface
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\Rendering {
+    interface RenderingContextInterface extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
+    {
+    }
+
+}
+
+namespace TYPO3\CMS\Fluid\Core\ViewHelper {
+    interface ViewHelperInterface extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\ViewHelper\Facets {
+    interface ChildNodeAccessInterface extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
+    {
+    }
+    interface CompilableInterface extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
+    {
+    }
+    interface PostParseInterface extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core {
+    class Exception extends \TYPO3Fluid\Fluid\Core\Exception
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\ViewHelper {
+    class Exception extends \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\ViewHelper\Exception {
+    class InvalidVariableException extends \TYPO3Fluid\Fluid\Core\Exception
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\View {
+    class Exception extends \TYPO3Fluid\Fluid\View\Exception
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\View\Exception {
+    class InvalidSectionException extends \TYPO3Fluid\Fluid\View\Exception\InvalidSectionException
+    {
+    }
+    class InvalidTemplateResourceException extends \TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
+    {
+    }
+
+}
+
+namespace TYPO3\CMS\Fluid\Core\Parser\SyntaxTree {
+    class RootNode extends \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode
+    {
+    }
+    class ViewHelperNode extends \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
+    {
+    }
+}
+
+namespace TYPO3\CMS\Fluid\Core\ViewHelper {
+    class TemplateVariableContainer extends \TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider
+    {
+    }
+    class ViewHelperVariableContainer extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer
+    {
+    }
+    class TagBuilder extends \TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder
+    {
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingStandaloneTest.php b/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingStandaloneTest.php
new file mode 100644
index 000000000000..04c047e36ed5
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingStandaloneTest.php
@@ -0,0 +1,120 @@
+<?php
+namespace TYPO3\Fluid\Tests\Functional;
+
+use TYPO3\CMS\Core\Tests\FunctionalTestCase;
+use TYPO3\CMS\Fluid\View\StandaloneView;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver;
+
+class EscapeChildrenRenderingStandaloneTest extends FunctionalTestCase
+{
+    protected $testExtensionsToLoad = ['typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test'];
+
+    protected $coreExtensionsToLoad = ['fluid'];
+
+    public function viewHelperTemplateSourcesDataProvider()
+    {
+        return [
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with children, properly encodes variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled>{settings.test}</ft:escapeChildrenEnabledAndEscapeOutputDisabled>',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with children, properly encodes variable value' =>
+            [
+                '{settings.test -> ft:escapeChildrenEnabledAndEscapeOutputDisabled()}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with argument, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{settings.test}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with argument, does not encode variable value' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: settings.test)}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with string, does not encode string value' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: \'<strong>Bla</strong>\')}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with argument in quotes, does encode variable value (encoded before passed to VH)' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: \'{settings.test}\')}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and children rendering, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{settings.test -> ft:escapeChildrenEnabledAndEscapeOutputDisabled()}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and argument in inline, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: settings.test)}" />',
+                '<strong>Bla</strong>'
+            ],
+
+
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with children, properly encodes variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled>{settings.test}</ft:escapeChildrenDisabledAndEscapeOutputDisabled>',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with children, properly encodes variable value' =>
+            [
+                '{settings.test -> ft:escapeChildrenDisabledAndEscapeOutputDisabled()}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with argument, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{settings.test}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with argument, does not encode variable value' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: settings.test)}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with string, does not encode string value' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: \'<strong>Bla</strong>\')}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with argument in quotes, does encode variable value (encoded before passed to VH)' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: \'{settings.test}\')}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and children rendering, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{settings.test -> ft:escapeChildrenDisabledAndEscapeOutputDisabled()}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and argument in inline, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: settings.test)}" />',
+                '<strong>Bla</strong>'
+            ],
+
+        ];
+    }
+
+    /**
+     * @param string $viewHelperTemplate
+     * @param string $expectedOutput
+     *
+     * @test
+     * @dataProvider viewHelperTemplateSourcesDataProvider
+     */
+    public function renderingTest($viewHelperTemplate, $expectedOutput)
+    {
+        $view = new StandaloneView();
+		$view->getRenderingContext()->getViewHelperResolver()->addNamespace('ft', 'TYPO3Fluid\\FluidTest\\ViewHelpers');
+		$view->getRenderingContext()->getTemplatePaths()->setTemplateSource($viewHelperTemplate);
+
+        $view->assign('settings', ['test' => '<strong>Bla</strong>']);
+
+        $this->assertSame($expectedOutput, $view->render());
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingTest.php b/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingTest.php
new file mode 100644
index 000000000000..67958816fd8d
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/EscapeChildrenRenderingTest.php
@@ -0,0 +1,120 @@
+<?php
+namespace TYPO3\Fluid\Tests\Functional;
+
+use TYPO3\CMS\Core\Tests\FunctionalTestCase;
+use TYPO3\CMS\Fluid\View\TemplateView;
+
+class EscapeChildrenRenderingTest extends FunctionalTestCase
+{
+    protected $testExtensionsToLoad = ['typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test'];
+
+    protected $coreExtensionsToLoad = ['fluid'];
+
+    public function viewHelperTemplateSourcesDataProvider()
+    {
+        return [
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with children, properly encodes variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled>{settings.test}</ft:escapeChildrenEnabledAndEscapeOutputDisabled>',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with children, properly encodes variable value' =>
+            [
+                '{settings.test -> ft:escapeChildrenEnabledAndEscapeOutputDisabled()}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with argument, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{settings.test}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with argument, does not encode variable value' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: settings.test)}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with string, does not encode string value' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: \'<strong>Bla</strong>\')}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Inline syntax with argument in quotes, does encode variable value (encoded before passed to VH)' =>
+            [
+                '{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: \'{settings.test}\')}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and children rendering, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{settings.test -> ft:escapeChildrenEnabledAndEscapeOutputDisabled()}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenEnabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and argument in inline, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenEnabledAndEscapeOutputDisabled content="{ft:escapeChildrenEnabledAndEscapeOutputDisabled(content: settings.test)}" />',
+                '<strong>Bla</strong>'
+            ],
+
+
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with children, properly encodes variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled>{settings.test}</ft:escapeChildrenDisabledAndEscapeOutputDisabled>',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with children, properly encodes variable value' =>
+            [
+                '{settings.test -> ft:escapeChildrenDisabledAndEscapeOutputDisabled()}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with argument, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{settings.test}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with argument, does not encode variable value' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: settings.test)}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with string, does not encode string value' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: \'<strong>Bla</strong>\')}',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Inline syntax with argument in quotes, does encode variable value (encoded before passed to VH)' =>
+            [
+                '{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: \'{settings.test}\')}',
+                '&lt;strong&gt;Bla&lt;/strong&gt;'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and children rendering, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{settings.test -> ft:escapeChildrenDisabledAndEscapeOutputDisabled()}" />',
+                '<strong>Bla</strong>'
+            ],
+            'EscapeChildrenDisabledAndEscapeOutputDisabled: Tag syntax with nested inline syntax and argument in inline, does not encode variable value' =>
+            [
+                '<ft:escapeChildrenDisabledAndEscapeOutputDisabled content="{ft:escapeChildrenDisabledAndEscapeOutputDisabled(content: settings.test)}" />',
+                '<strong>Bla</strong>'
+            ],
+
+        ];
+    }
+
+    /**
+     * @param string $viewHelperTemplate
+     * @param string $expectedOutput
+     *
+     * @test
+     * @dataProvider viewHelperTemplateSourcesDataProvider
+     */
+    public function renderingTest($viewHelperTemplate, $expectedOutput)
+    {
+        $view = new TemplateView();
+        $view->assign('settings', ['test' => '<strong>Bla</strong>']);
+        $templateString = "{namespace ft=TYPO3Fluid\\FluidTest\\ViewHelpers}";
+        $templateString .= $viewHelperTemplate;
+		$view->getRenderingContext()->getViewHelperResolver()->addNamespace('ft', 'TYPO3Fluid\\FluidTest\\ViewHelpers');
+		$view->getRenderingContext()->getTemplatePaths()->setTemplateSource($viewHelperTemplate);
+
+        $this->assertSame($expectedOutput, $view->render());
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/.gitignore b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/.gitignore
new file mode 100644
index 000000000000..385375f939e5
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/.gitignore
@@ -0,0 +1,2 @@
+.Build/*
+composer.lock
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/AbstractEscapingBaseViewHelper.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/AbstractEscapingBaseViewHelper.php
new file mode 100644
index 000000000000..1c747d4c9882
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/AbstractEscapingBaseViewHelper.php
@@ -0,0 +1,42 @@
+<?php
+namespace TYPO3Fluid\FluidTest\ViewHelpers;
+
+/*
+ * 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!
+ */
+
+//use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
+use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
+
+/**
+ * Class EscapingInterceptorDisabledViewHelper
+ */
+abstract class AbstractEscapingBaseViewHelper extends AbstractViewHelper
+{
+    public function initializeArguments()
+    {
+        $this->registerArgument('content', 'string', 'Content provided as argument', false, null);
+    }
+
+    /**
+     * @return string
+     */
+    public function render()
+    {
+        if (!isset($this->arguments['content'])) {
+            $content = $this->renderChildren();
+        } else {
+            $content = $this->arguments['content'];
+        }
+        return $content;
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper.php
new file mode 100644
index 000000000000..39ce0379ecd0
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper.php
@@ -0,0 +1,24 @@
+<?php
+namespace TYPO3Fluid\FluidTest\ViewHelpers;
+
+/*
+ * 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!
+ */
+
+/**
+ * Class EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper
+ */
+class EscapeChildrenDisabledAndEscapeOutputDisabledViewHelper extends AbstractEscapingBaseViewHelper
+{
+    protected $escapeChildren = false;
+    protected $escapeOutput = false;
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper.php
new file mode 100644
index 000000000000..a77e0254e66d
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper.php
@@ -0,0 +1,24 @@
+<?php
+namespace TYPO3Fluid\FluidTest\ViewHelpers;
+
+/*
+ * 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!
+ */
+
+/**
+ * Class EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper
+ */
+class EscapeChildrenDisabledAndEscapeOutputEnabledViewHelper extends AbstractEscapingBaseViewHelper
+{
+    protected $escapeChildren = false;
+    protected $escapeOutput = true;
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper.php
new file mode 100644
index 000000000000..75edf1be36b4
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper.php
@@ -0,0 +1,24 @@
+<?php
+namespace TYPO3Fluid\FluidTest\ViewHelpers;
+
+/*
+ * 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!
+ */
+
+/**
+ * Class EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper
+ */
+class EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper extends AbstractEscapingBaseViewHelper
+{
+    protected $escapeChildren = true;
+    protected $escapeOutput = false;
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Compiler/Fixtures/AbstractCompiledTemplate.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper.php
similarity index 61%
rename from typo3/sysext/fluid/Tests/Unit/Core/Compiler/Fixtures/AbstractCompiledTemplate.php
rename to typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper.php
index 0140d946c7b5..b98a4895b3e3 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Compiler/Fixtures/AbstractCompiledTemplate.php
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper.php
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Compiler\Fixtures;
+namespace TYPO3Fluid\FluidTest\ViewHelpers;
 
 /*
  * This file is part of the TYPO3 CMS project.
@@ -15,9 +15,10 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Compiler\Fixtures;
  */
 
 /**
- * Class AbstractCompiledTemplate
+ * Class EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper
  */
-abstract class AbstractCompiledTemplate extends \TYPO3\CMS\Fluid\Core\Compiler\AbstractCompiledTemplate
+class EscapeChildrenEnabledAndEscapeOutputEnabledViewHelper extends AbstractEscapingBaseViewHelper
 {
-    protected static $defaultEncoding = 'ISO-8859-1';
+    protected $escapeChildren = true;
+    protected $escapeOutput = true;
 }
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/README.md b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/README.md
new file mode 100644
index 000000000000..b0b289430b07
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/README.md
@@ -0,0 +1,2 @@
+# Fluid Rendering Test Extension for TYPO3 [![Build Status](https://travis-ci.org/helhum/fluid_test.svg?branch=master)](https://travis-ci.org/helhum/fluid_test)
+
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/composer.json b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/composer.json
new file mode 100644
index 000000000000..aa7ddc3de043
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/composer.json
@@ -0,0 +1,58 @@
+{
+    "name": "typo3fluid/fluid-test",
+    "type": "typo3-cms-extension",
+    "description": "Some Fluid rendering tests",
+    "keywords": [
+        "TYPO3",
+        "extension",
+        "fluid"
+    ],
+    "homepage": "http://helhum.io",
+    "authors": [
+        {
+            "name": "Helmut Hummel",
+            "email": "info@helhum.io",
+            "role": "Developer",
+            "homepage": "http://helhum.io"
+        }
+    ],
+    "license": "GPL-2.0+",
+    "repositories": [
+        {"type": "vcs", "url": "/Users/helmut/Developer/TYPO3/master"}
+    ],
+    "autoload": {
+        "psr-4": {
+            "TYPO3Fluid\\FluidTest\\": "Classes"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "TYPO3Fluid\\FluidTest\\Tests\\": "Tests",
+            "TYPO3\\CMS\\Core\\Tests\\": ".Build/vendor/typo3/cms/typo3/sysext/core/Tests/",
+            "TYPO3\\CMS\\Fluid\\Tests\\": ".Build/vendor/typo3/cms/typo3/sysext/fluid/Tests/"
+        }
+    },
+    "replace": {
+        "fluid_test": "self.version",
+        "typo3-ter/ext-scaffold": "self.version"
+    },
+    "config": {
+        "vendor-dir": ".Build/vendor",
+        "bin-dir": ".Build/bin"
+    },
+    "scripts": {
+        "post-autoload-dump": [
+            "mkdir -p .Build/Web/typo3conf/ext/",
+            "[ -L .Build/Web/typo3conf/ext/fluid_test ] || ln -snvf ../../../../. .Build/Web/typo3conf/ext/fluid_test"
+        ]
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.0.x-dev"
+        },
+        "typo3/cms": {
+            "cms-package-dir": "{$vendor-dir}/typo3/cms",
+            "web-dir": ".Build/Web"
+        }
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_emconf.php b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_emconf.php
new file mode 100644
index 000000000000..8f98522a9f92
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_emconf.php
@@ -0,0 +1,47 @@
+<?php
+$EM_CONF[$_EXTKEY] = array (
+  'title' => 'Extension skeleton for TYPO3 7',
+  'description' => 'Description for ext',
+  'category' => 'Example Extensions',
+  'author' => 'Helmut Hummel',
+  'author_email' => 'info@helhum.io',
+  'author_company' => 'helhum.io',
+  'shy' => '',
+  'priority' => '',
+  'module' => '',
+  'state' => 'stable',
+  'internal' => '',
+  'uploadfolder' => '0',
+  'createDirs' => '',
+  'modify_tables' => '',
+  'clearCacheOnLoad' => 0,
+  'lockType' => '',
+  'version' => '0.0.2',
+  'constraints' => 
+  array (
+    'depends' => 
+    array (
+      'typo3' => '7.5.0-7.99.99',
+    ),
+    'conflicts' => 
+    array (
+    ),
+    'suggests' => 
+    array (
+    ),
+  ),
+  'autoload' => 
+  array (
+    'psr-4' => 
+    array (
+      'TYPO3Fluid\\FluidTest\\' => 'Classes',
+    ),
+  ),
+  'autoload-dev' => 
+  array (
+    'psr-4' => 
+    array (
+      'TYPO3Fluid\\FluidTest\\Tests\\' => 'Tests',
+    ),
+  ),
+);
diff --git a/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_icon.gif b/typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/ext_icon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1a832d4b660d1b498d5f980098a7c3953ff69a8f
GIT binary patch
literal 177
zcmV;i08al$Nk%w1VG;lk0J8!BWo2cKj*jy3@|l^L$;ruVY;1*vg|V@*=H}+t*Vju+
zOI1}>D=RBPLPGxj{r~^~A^8LW00062EC2ui01^NY000DDP{>KEmFXN=lmdfw08JA}
z4Wlvz6_lkRDJ!#33)}#bQJ)i%E+I(Nh?AENSWw+41YJXc5Fk<nOHL=VW-SA0<9o3x
fq>4ec9G3FRl5J_Rh9}OA1rm-a80vh15)lA9z(qn}

literal 0
HcmV?d00001

diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Cache/FluidTemplateCacheTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Cache/FluidTemplateCacheTest.php
new file mode 100644
index 000000000000..fda40c5d1a55
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Cache/FluidTemplateCacheTest.php
@@ -0,0 +1,77 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Cache;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface;
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache;
+
+/**
+ * Test case
+ */
+class FluidTemplateCacheTest extends UnitTestCase
+{
+    /**
+     * @test
+     */
+    public function flushCallsFlushOnBackend()
+    {
+        $backend = $this->getMock(PhpCapableBackendInterface::class);
+        $backend->expects($this->once())->method('flush');
+        $instance = new FluidTemplateCache('dummy', $backend);
+        $instance->flush();
+    }
+
+    /**
+     * @test
+     */
+    public function getDelegatesToRequireOnce()
+    {
+        $instance = $this->getMock(FluidTemplateCache::class, array('requireOnce'), array(), '', false);
+        $instance->expects($this->once())->method('requireOnce')->with('foobar');
+        $instance->get('foobar');
+    }
+
+    /**
+     * @test
+     */
+    public function setCallsSetOnBackend()
+    {
+        $backend = $this->getMock(PhpCapableBackendInterface::class);
+        $backend->expects($this->once())->method('set')->with(
+            'test',
+            '<?php' . PHP_EOL . 'test' . PHP_EOL . '#',
+            array('foobar'),
+            $this->anything()
+        );
+        $instance = new FluidTemplateCache('dummy', $backend);
+        $instance->set('test', 'test', array('foobar'));
+    }
+
+    /**
+     * @test
+     */
+    public function setRemovesLeadingPhpTagBeforeCallingParentWhichAddsLeadingPhpTag()
+    {
+        $backend = $this->getMock(PhpCapableBackendInterface::class);
+        $backend->expects($this->once())->method('set')->with(
+            'test',
+            '<?php' . PHP_EOL . 'test' . PHP_EOL . '#',
+            array('foobar'),
+            $this->anything()
+        );
+        $instance = new FluidTemplateCache('dummy', $backend);
+        $instance->set('test', '<?php' . PHP_EOL . 'test', array('foobar'));
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Compiler/AbstractCompilerTemplateTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Compiler/AbstractCompilerTemplateTest.php
deleted file mode 100644
index d6601e90c19b..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Compiler/AbstractCompilerTemplateTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Compiler;
-
-/*
- * 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!
- */
-
-/**
- * Test case
- */
-class AbstractCompilerTemplateTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     */
-    public function resolveDefaultEncodingWillBeSetToUtf8IfNotSet()
-    {
-        $this->assertSame('UTF-8', \TYPO3\CMS\Fluid\Core\Compiler\AbstractCompiledTemplate::resolveDefaultEncoding());
-    }
-
-    /**
-     * @test
-     */
-    public function isDefaultEncodingIsSetThanDefaultEncodingWillReturned()
-    {
-        $this->assertSame('ISO-8859-1', \TYPO3\CMS\Fluid\Tests\Unit\Core\Compiler\Fixtures\AbstractCompiledTemplate::resolveDefaultEncoding());
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper.php b/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper.php
index 47212c5e7152..2709f72b4a59 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper.php
@@ -1,6 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures;
 
+/*
+ * 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!
+ */
+
+/**
+ * Class TestViewHelper
+ */
 class TestViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper2.php b/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper2.php
index 0f5b4922b6b3..a96bb4906007 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper2.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestViewHelper2.php
@@ -1,6 +1,22 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures;
 
+/*
+ * 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!
+ */
+
+/**
+ * Class TestViewHelper2
+ */
 class TestViewHelper2 extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 {
     /**
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/ChildNodeAccessFacetViewHelper.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/ChildNodeAccessFacetViewHelper.php
deleted file mode 100644
index e0b87d8dd866..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/ChildNodeAccessFacetViewHelper.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test fixture for the child node access facet.
- */
-abstract class ChildNodeAccessFacetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface
-{
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/PostParseFacetViewHelper.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/PostParseFacetViewHelper.php
deleted file mode 100644
index b5aee6406d29..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/PostParseFacetViewHelper.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Enter description here...
- */
-class PostParseFacetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\PostParseInterface
-{
-    public static $wasCalled = false;
-
-    public function __construct()
-    {
-    }
-
-    public static function postParseEvent(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $viewHelperNode, array $arguments, \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer)
-    {
-        self::$wasCalled = true;
-    }
-
-    public function initializeArguments()
-    {
-    }
-
-    public function render()
-    {
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand-split.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand-split.php
deleted file mode 100644
index 68fede259e30..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand-split.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-
-return array('
-a{f:base()}b');
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand.html b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand.html
deleted file mode 100644
index 43f634edf6f1..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture01-shorthand.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-a{f:base()}b
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php
deleted file mode 100644
index cd6867b346f6..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-return array('{namespace foo=TYPO3\CMS\Fluid\ViewHelpers}<foo:format.nl2br><foo:format.number decimals="1">{number}</foo:format.number></foo:format.nl2br>');
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06.html b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06.html
deleted file mode 100644
index bfd31895d2c6..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06.html
+++ /dev/null
@@ -1 +0,0 @@
-{namespace foo=TYPO3\CMS\Fluid\ViewHelpers}<foo:format.nl2br><foo:format.number decimals="1">{number}</foo:format.number></foo:format.nl2br>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php
deleted file mode 100644
index 0f04627cae5c..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-return array(
-    '<f:format.printf arguments="{number : 362525200}">',
-    '%.3e',
-    '</f:format.printf>'
-);
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14.html b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14.html
deleted file mode 100644
index 1e416687b93f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14.html
+++ /dev/null
@@ -1 +0,0 @@
-<f:format.printf arguments="{number : 362525200}">%.3e</f:format.printf>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Interceptor/EscapeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/Interceptor/EscapeTest.php
deleted file mode 100644
index e4dd03fcff7f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/Interceptor/EscapeTest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Interceptor;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class EscapeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\Interceptor\Escape
-     */
-    protected $escapeInterceptor;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
-     */
-    protected $mockViewHelper;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
-     */
-    protected $mockNode;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\ParsingState
-     */
-    protected $mockParsingState;
-
-    protected function setUp()
-    {
-        $this->escapeInterceptor = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\Interceptor\Escape::class, array('dummy'));
-        $this->mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-        $this->mockNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', false);
-        $this->mockParsingState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-    }
-
-    /**
-     * @test
-     */
-    public function processDoesNotDisableEscapingInterceptorByDefault()
-    {
-        $interceptorPosition = \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER;
-        $this->mockViewHelper->expects($this->once())->method('isEscapingInterceptorEnabled')->will($this->returnValue(true));
-        $this->mockNode->expects($this->once())->method('getUninitializedViewHelper')->will($this->returnValue($this->mockViewHelper));
-
-        $this->assertTrue($this->escapeInterceptor->_get('interceptorEnabled'));
-        $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
-        $this->assertTrue($this->escapeInterceptor->_get('interceptorEnabled'));
-    }
-
-    /**
-     * @test
-     */
-    public function processDisablesEscapingInterceptorIfViewHelperDisablesIt()
-    {
-        $interceptorPosition = \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER;
-        $this->mockViewHelper->expects($this->once())->method('isEscapingInterceptorEnabled')->will($this->returnValue(false));
-        $this->mockNode->expects($this->once())->method('getUninitializedViewHelper')->will($this->returnValue($this->mockViewHelper));
-
-        $this->assertTrue($this->escapeInterceptor->_get('interceptorEnabled'));
-        $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
-        $this->assertFalse($this->escapeInterceptor->_get('interceptorEnabled'));
-    }
-
-    /**
-     * @test
-     */
-    public function processReenablesEscapingInterceptorOnClosingViewHelperTagIfItWasDisabledBefore()
-    {
-        $interceptorPosition = \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER;
-
-        $this->escapeInterceptor->_set('interceptorEnabled', false);
-        $this->escapeInterceptor->_set('viewHelperNodesWhichDisableTheInterceptor', array($this->mockNode));
-
-        $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
-        $this->assertTrue($this->escapeInterceptor->_get('interceptorEnabled'));
-    }
-
-    /**
-     * @test
-     */
-    public function processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor()
-    {
-        $interceptorPosition = \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR;
-        $mockNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', false);
-        $mockEscapeViewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class);
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class)->will($this->returnValue($mockEscapeViewHelper));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, $mockEscapeViewHelper, array('value' => $mockNode))->will($this->returnValue($this->mockNode));
-        $this->escapeInterceptor->_set('objectManager', $mockObjectManager);
-
-        $actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
-        $this->assertSame($this->mockNode, $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/ParsingStateTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/ParsingStateTest.php
deleted file mode 100644
index fced5830ace6..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/ParsingStateTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class ParsingStateTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * Parsing state
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Parser\ParsingState
-     */
-    protected $parsingState;
-
-    protected function setUp()
-    {
-        $this->parsingState = new \TYPO3\CMS\Fluid\Core\Parser\ParsingState();
-    }
-
-    /**
-     * @test
-     */
-    public function setRootNodeCanBeReadOutAgain()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $this->parsingState->setRootNode($rootNode);
-        $this->assertSame($this->parsingState->getRootNode(), $rootNode, 'Root node could not be read out again.');
-    }
-
-    /**
-     * @test
-     */
-    public function pushAndGetFromStackWorks()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $this->parsingState->pushNodeToStack($rootNode);
-        $this->assertSame($rootNode, $this->parsingState->getNodeFromStack($rootNode), 'Node returned from stack was not the right one.');
-        $this->assertSame($rootNode, $this->parsingState->popNodeFromStack($rootNode), 'Node popped from stack was not the right one.');
-    }
-
-    /**
-     * @test
-     */
-    public function renderCallsTheRightMethodsOnTheRootNode()
-    {
-        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
-
-        $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-        $rootNode->expects($this->once())->method('evaluate')->with($renderingContext)->will($this->returnValue('T3DD09 Rock!'));
-        $this->parsingState->setRootNode($rootNode);
-        $renderedValue = $this->parsingState->render($renderingContext);
-        $this->assertEquals($renderedValue, 'T3DD09 Rock!', 'The rendered value of the Root Node is not returned by the ParsingState.');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessorTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessorTest.php
new file mode 100644
index 000000000000..ec2d80122852
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessorTest.php
@@ -0,0 +1,235 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\PreProcessor;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Fluid\Core\Parser\PreProcessor\XmlnsNamespaceTemplatePreProcessor;
+use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
+
+/**
+ * Class XmlnsNamespaceTemplatePreProcessorTest
+ */
+class XmlnsNamespaceTemplatePreProcessorTest extends UnitTestCase
+{
+    /**
+     * @param string $source
+     * @param array $expectedNamespaces
+     * @param string $expectedSource
+     * @test
+     * @dataProvider preProcessSourceExtractsNamespacesAndRemovesTagsAndAttributesDataProvider
+     */
+    public function preProcessSourceExtractsNamespacesAndRemovesTagsAndAttributes($source, array $expectedNamespaces, $expectedSource)
+    {
+        $subject = new XmlnsNamespaceTemplatePreProcessor();
+        $resolver = $this->getMock(ViewHelperResolver::class, array('addNamespace'));
+        $context = $this->getMock(RenderingContextFixture::class, array('getViewHelperResolver'));
+        if (empty($expectedNamespaces)) {
+            $context->expects($this->never())->method('getViewHelperResolver');
+            $resolver->expects($this->never())->method('addNamespace');
+        } else {
+            $context->expects($this->exactly(count($expectedNamespaces)))->method('getViewHelperResolver')->willReturn($resolver);
+            foreach ($expectedNamespaces as $index => $expectedNamespaceParts) {
+                list($prefix, $phpNamespace) = $expectedNamespaceParts;
+                $resolver->expects($this->at($index))->method('addNamespace')->with($prefix, $phpNamespace);
+            }
+        }
+        $subject->setRenderingContext($context);
+        $result = $subject->preProcessSource($source);
+        if ($expectedSource === null) {
+            $this->assertEquals($source, $result);
+        } else {
+            $this->assertEquals($expectedSource, $result);
+        }
+    }
+
+    /**
+     * DataProvider for preProcessSourceExtractsNamespacesAndRemovesTagsAndAttributes test
+     *
+     * @return array
+     */
+    public function preProcessSourceExtractsNamespacesAndRemovesTagsAndAttributesDataProvider()
+    {
+        return [
+            'Empty source raises no errors' => array(
+                '',
+                [],
+                null,
+            ),
+            'Tags without xmlns remain untouched' => array(
+                '<div class="not-touched">...</div>',
+                [],
+                null
+            ),
+            'Third-party namespace not detected' => array(
+                '<html xmlns:notdetected="http://thirdparty.org/ns/Foo/Bar/ViewHelpers">...</html>',
+                [],
+                null
+            ),
+            'Detects and removes Fluid namespaces by namespace URL' => array(
+                '<html xmlns:detected="http://typo3.org/ns/Foo/Bar/ViewHelpers" data-namespace-typo3-fluid="true">...</html>',
+                [
+                    ['detected', 'Foo\\Bar\\ViewHelpers']
+                ],
+                '...'
+            ),
+            'Skips fluid namespace if namespace URL is not the correct case' => array(
+                '<html xmlns:detected="http://typo3.org/Ns/Foo/Bar/ViewHelpers" data-namespace-typo3-fluid="true">...</html>',
+                [],
+                null
+            ),
+            'Skips fluid namespace if attribute is not the correct case' => array(
+                '<html xmlNS:detected="http://typo3.org/ns/Foo/Bar/ViewHelpers" data-namespace-typo3-fluid="true">...</html>',
+                [],
+                null
+            ),
+            'Skips namespace if attribute before xmlns attribute without space in between' => array(
+                '<html lang="de"xmlns:detected="http://typo3.org/ns/Foo/Bar/ViewHelpers" data-namespace-typo3-fluid="true">...</html>',
+                [],
+                null
+            ),
+            'Removes tag if data attribute set and non xmlns attributes are used prior to xmlns' => array(
+                '<html lang="de" xmlns:detected="http://typo3.org/ns/Foo/Bar/ViewHelpers" data-namespace-typo3-fluid="true">...</html>',
+                [
+                    ['detected', 'Foo\\Bar\\ViewHelpers']
+                ],
+                '...'
+            ),
+            'Skips invalid namespace prefixes' => array(
+                '<html xmlns:bad-prefix="http://typo3.org/ns/Foo/Bar/ViewHelpers">...</html>',
+                [],
+                null
+            ),
+            'Detect and remove multiple ViewHelper attributes' => array(
+                '<div xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+                [
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers'],
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers']
+                ],
+                '<div >' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>'
+            ),
+            'ViewHelpers found with non ViewHelper xmlns at beginning' => array(
+                '<div xmlns:z="http://www.typo3.org/foo"' . "\n"
+                    . "\t" . 'xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+                [
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers'],
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers']
+                ],
+                '<div xmlns:z="http://www.typo3.org/foo" >' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>'
+            ),
+            'ViewHelpers found with non ViewHelper xmlns at end' => array(
+                '<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+                [
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers'],
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers']
+                ],
+                '<div xmlns:z="http://www.typo3.org/foo">' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+            ),
+            'Xmlns ViewHelpers found with multiple non ViewHelper xmlns attributes' => array(
+                '<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:y="http://www.typo3.org/bar"' . "\n"
+                    . "\t" . 'xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+                [
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers'],
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers']
+                ],
+                '<div xmlns:y="http://www.typo3.org/bar" xmlns:z="http://www.typo3.org/foo">' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>'
+            ),
+            'Xmlns ViewHelpers found with non ViewHelpers between' => array(
+                '<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                . "\t" . 'xmlns:z="http://www.typo3.org/foo"' . "\n"
+                . "\t" . 'xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>',
+                [
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers'],
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers']
+                ],
+                '<div xmlns:z="http://www.typo3.org/foo" >' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</div>'
+            ),
+            'Do not remove Html tag with data attribute but no xmlns ViewHelpers found' => array(
+                '<html data-namespace-typo3-fluid="true">' . "\n"
+                    . "\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</html>',
+                [],
+                null
+            ),
+            'Keep html tag if data attribute is not set and remove ViewHelper attributes' => array(
+                '<html xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</html>',
+                [
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers'],
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers']
+                ],
+                '<html xmlns:z="http://www.typo3.org/foo">' . "\n"
+                    . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</html>',
+            ),
+            'Remove html tag because xmlns ViewHelpers found and data attribute set' => array(
+                '<html data-namespace-typo3-fluid="true"' . "\n"
+                    . "\t" . 'xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                    . "\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                        . "\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                . '</html>',
+                [
+                    ['fe', 'TYPO3\\CMS\\Frontend\\ViewHelpers']
+                ],
+                "\n\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+            ),
+            'Only handle first tag with xmlns ViewHelpers found' => array(
+                '<div xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">' . "\n"
+                    . "\t" . '<div data-namespace-typo3-fluid="true" xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                        . "\t\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                            . "\t\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                    . "\t" . '</div>' . "\n"
+                . '</div>',
+                [
+                    ['f', 'TYPO3\\CMS\\Fluid\\ViewHelpers']
+                ],
+                '<div >' . "\n"
+                    . "\t" . '<div data-namespace-typo3-fluid="true" xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"' . "\n"
+                        . "\t\t" . 'xmlns:z="http://www.typo3.org/foo">' . "\n"
+                            . "\t\t\t" . '<f:if condition="{demo}">Hello World</f:if>' . "\n"
+                    . "\t" . '</div>' . "\n"
+                . '</div>'
+            )
+        ];
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/AbstractNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/AbstractNodeTest.php
deleted file mode 100644
index f4c0e67feb3f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/AbstractNodeTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class AbstractNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    protected $renderingContext;
-
-    protected $abstractNode;
-
-    protected $childNode;
-
-    protected function setUp()
-    {
-        $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array(), array(), '', false);
-
-        $this->abstractNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array('evaluate'));
-
-        $this->childNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
-        $this->abstractNode->addChildNode($this->childNode);
-    }
-
-    /**
-     * @test
-     */
-    public function evaluateChildNodesPassesRenderingContextToChildNodes()
-    {
-        $this->childNode->expects($this->once())->method('evaluate')->with($this->renderingContext);
-        $this->abstractNode->evaluateChildNodes($this->renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function childNodeCanBeReadOutAgain()
-    {
-        $this->assertSame($this->abstractNode->getChildNodes(), array($this->childNode));
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php
deleted file mode 100644
index 2b2be1cf7006..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php
+++ /dev/null
@@ -1,499 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class BooleanNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
-     */
-    protected $viewHelperNode;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
-     */
-    protected $renderingContext;
-
-    /**
-     * Setup fixture
-     */
-    protected function setUp()
-    {
-        $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function havingMoreThanThreeElementsInTheSyntaxTreeThrowsException()
-    {
-        $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-        $rootNode->expects($this->once())->method('getChildNodes')->will($this->returnValue(array(1, 2, 3, 4)));
-
-        new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-    }
-
-    /**
-     * @test
-     */
-    public function comparingEqualNumbersReturnsTrue()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function comparingUnequalNumbersReturnsFalse()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function notEqualReturnsFalseIfNumbersAreEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function notEqualReturnsTrueIfNumbersAreNotEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function oddNumberModulo2ReturnsTrue()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('43'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function evenNumberModulo2ReturnsFalse()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('42'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function greaterThanReturnsTrueIfNumberIsReallyGreater()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function greaterThanReturnsFalseIfNumberIsEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function greaterOrEqualsReturnsTrueIfNumberIsReallyGreater()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function greaterOrEqualsReturnsTrueIfNumberIsEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function greaterOrEqualsReturnFalseIfNumberIsSmaller()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessThanReturnsTrueIfNumberIsReallyless()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessThanReturnsFalseIfNumberIsEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessOrEqualsReturnsTrueIfNumberIsReallyLess()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessOrEqualsReturnsTrueIfNumberIsEqual()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessOrEqualsReturnFalseIfNumberIsBigger()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function lessOrEqualsReturnFalseIfComparingWithANegativeNumber()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11 <= -2.1'));
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function notEqualReturnsFalseIfComparingMatchingStrings()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != "stringA"'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function notEqualReturnsTrueIfComparingNonMatchingStrings()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != \'stringB\''));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function equalsReturnsFalseIfComparingNonMatchingStrings()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == \'stringB\''));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function equalsReturnsTrueIfComparingMatchingStrings()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == "stringA"'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function equalsReturnsTrueIfComparingMatchingStringsWithEscapedQuotes()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'\\\'stringA\\\'\' == \'\\\'stringA\\\'\''));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function equalsReturnsFalseIfComparingStringWithNonZero()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 42'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function equalsReturnsTrueIfComparingStringWithZero()
-    {
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 0'));
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function objectsAreComparedStrictly()
-    {
-        $object1 = new \stdClass();
-        $object2 = new \stdClass();
-
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-
-        $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
-        $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
-
-        $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
-        $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
-
-        $rootNode->addChildNode($object1Node);
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
-        $rootNode->addChildNode($object2Node);
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertFalse($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function objectsAreComparedStrictlyInUnequalComparison()
-    {
-        $object1 = new \stdClass();
-        $object2 = new \stdClass();
-
-        $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
-
-        $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
-        $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
-
-        $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
-        $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
-
-        $rootNode->addChildNode($object1Node);
-        $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
-        $rootNode->addChildNode($object2Node);
-
-        $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
-        $this->assertTrue($booleanNode->evaluate($this->renderingContext));
-    }
-
-    /**
-     * @test
-     */
-    public function convertToBooleanProperlyConvertsValuesOfTypeBoolean()
-    {
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(false));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(true));
-    }
-
-    /**
-     * @test
-     */
-    public function convertToBooleanProperlyConvertsValuesOfTypeString()
-    {
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(''));
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('false'));
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('FALSE'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('true'));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('TRUE'));
-    }
-
-    /**
-     * @test
-     */
-    public function convertToBooleanProperlyConvertsNumericValues()
-    {
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(false));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(true));
-
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0));
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0'));
-
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.0));
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.0'));
-
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x0));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x1'));
-
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0e0));
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0e0'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1e0));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1e0'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-1));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-1'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-0.5));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-0.5'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.5));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.5'));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x10'));
-    }
-
-    /**
-     * @test
-     */
-    public function convertToBooleanProperlyConvertsValuesOfTypeArray()
-    {
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array()));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array('foo')));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array('foo' => 'bar')));
-    }
-
-    /**
-     * @test
-     */
-    public function convertToBooleanProperlyConvertsObjects()
-    {
-        $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(null));
-
-        $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(new \stdClass()));
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/LegacyNamespaceExpressionNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/LegacyNamespaceExpressionNodeTest.php
new file mode 100644
index 000000000000..2de770212eab
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/LegacyNamespaceExpressionNodeTest.php
@@ -0,0 +1,56 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\Expression\LegacyNamespaceExpressionNode;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
+
+/**
+ * Class LegacyNamespaceExpressionNodeTest
+ */
+class LegacyNamespaceExpressionNodeTest extends UnitTestCase
+{
+    /**
+     * @test
+     * @dataProvider getEvaluateExpressionTestValues
+     * @param array $matches
+     * @param array $expected
+     */
+    public function evaluateExpressionExtractsNamespaces(array $matches, array $expected)
+    {
+        $resolver = $this->getMock('TYPO3Fluid\\Fluid\\Core\\ViewHelper\\ViewHelperResolver', array('addNamespace'));
+        $resolver->expects($this->once())->method('addNamespace')->with($expected[0], $expected[1]);
+        $context = $this->getMock(RenderingContextFixture::class, array('getViewHelperResolver'));
+        $context->expects($this->once())->method('getViewHelperResolver')->willReturn($resolver);
+        LegacyNamespaceExpressionNode::evaluateExpression($context, $matches[0], $matches);
+    }
+
+    /**
+     * @return array
+     */
+    public function getEvaluateExpressionTestValues()
+    {
+        return array(
+            array(
+                array('foo', 'bar', 'baz'),
+                array('bar', 'baz')
+            ),
+            array(
+                array('test1', 'test2', 'test3'),
+                array('test2', 'test3')
+            )
+        );
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/NumericNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/NumericNodeTest.php
deleted file mode 100644
index c07fc8427064..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/NumericNodeTest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script belongs to the TYPO3 Flow package "Fluid".                 *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- * of the License, or (at your option) any later version.                 *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class NumericNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     */
-    public function renderReturnsProperIntegerGivenInConstructor()
-    {
-        $string = '1';
-        $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
-        $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), 1, 'The rendered value of a numeric node does not match the string given in the constructor.');
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsProperFloatGivenInConstructor()
-    {
-        $string = '1.1';
-        $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
-        $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), 1.1, 'The rendered value of a numeric node does not match the string given in the constructor.');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function constructorThrowsExceptionIfNoNumericGiven()
-    {
-        new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode('foo');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function addChildNodeThrowsException()
-    {
-        $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode('1');
-        $node->addChildNode(clone $node);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/TextNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/TextNodeTest.php
deleted file mode 100644
index 19594c097cb5..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/TextNodeTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class TextNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     */
-    public function renderReturnsSameStringAsGivenInConstructor()
-    {
-        $string = 'I can work quite effectively in a train!';
-        $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode($string);
-        $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), $string, 'The rendered string of a text node is not the same as the string given in the constructor.');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function constructorThrowsExceptionIfNoStringGiven()
-    {
-        new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode(123);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php
deleted file mode 100644
index 97a873de7c6f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class ViewHelperNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * Rendering Context
-     *
-     * @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
-     */
-    protected $renderingContext;
-
-    /**
-     * Object factory mock
-     *
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     */
-    protected $mockObjectManager;
-
-    /**
-     * Template Variable Container
-     *
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
-     */
-    protected $templateVariableContainer;
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
-     */
-    protected $controllerContext;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
-     */
-    protected $viewHelperVariableContainer;
-
-    /**
-     * Setup fixture
-     */
-    protected function setUp()
-    {
-        $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class);
-
-        $this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $this->renderingContext->_set('objectManager', $this->mockObjectManager);
-
-        $this->templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
-        $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
-
-        $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
-        $this->renderingContext->setControllerContext($this->controllerContext);
-
-        $this->viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
-        $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
-    }
-
-    /**
-     * @test
-     */
-    public function constructorSetsViewHelperAndArguments()
-    {
-        $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-        $arguments = array('foo' => 'bar');
-        $viewHelperNode = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('dummy'), array($viewHelper, $arguments));
-
-        $this->assertEquals(get_class($viewHelper), $viewHelperNode->getViewHelperClassName());
-        $this->assertEquals($arguments, $viewHelperNode->_get('arguments'));
-    }
-
-    /**
-     * @test
-     */
-    public function childNodeAccessFacetWorksAsExpected()
-    {
-        $childNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array('foo'));
-
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\ChildNodeAccessFacetViewHelper::class, array('setChildNodes', 'initializeArguments', 'render', 'prepareArguments'));
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
-        $viewHelperNode->addChildNode($childNode);
-
-        $mockViewHelper->expects($this->once())->method('setChildNodes')->with($this->equalTo(array($childNode)));
-
-        $viewHelperNode->evaluate($this->renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function initializeArgumentsAndRenderIsCalledByViewHelperNode()
-    {
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('initializeArgumentsAndRender', 'prepareArguments'));
-        $mockViewHelper->expects($this->once())->method('initializeArgumentsAndRender');
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
-
-        $viewHelperNode->evaluate($this->renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function initializeArgumentsAndRenderIsCalledWithCorrectArguments()
-    {
-        $arguments = array(
-            'param0' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param1', 'string', 'Hallo', true, null, false),
-            'param1' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param1', 'string', 'Hallo', true, null, true),
-            'param2' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param2', 'string', 'Hallo', true, null, true)
-        );
-
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('initializeArgumentsAndRender', 'prepareArguments'));
-        $mockViewHelper->expects($this->any())->method('prepareArguments')->will($this->returnValue($arguments));
-        $mockViewHelper->expects($this->once())->method('initializeArgumentsAndRender');
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array(
-            'param2' => new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('b'),
-            'param1' => new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('a')
-        ));
-
-        $viewHelperNode->evaluate($this->renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function evaluateMethodPassesRenderingContextToViewHelper()
-    {
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'validateArguments', 'prepareArguments', 'setRenderingContext'));
-        $mockViewHelper->expects($this->once())->method('setRenderingContext')->with($this->renderingContext);
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
-
-        $viewHelperNode->evaluate($this->renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function multipleEvaluateCallsShareTheSameViewHelperInstance()
-    {
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'validateArguments', 'prepareArguments', 'setViewHelperVariableContainer'));
-        $mockViewHelper->expects($this->any())->method('render')->will($this->returnValue('String'));
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
-
-        $viewHelperNode->evaluate($this->renderingContext);
-        $viewHelperNode->evaluate($this->renderingContext);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserPatternTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserPatternTest.php
deleted file mode 100644
index 14b24578e74e..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserPatternTest.php
+++ /dev/null
@@ -1,379 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case for Regular expressions in parser
- */
-class TemplateParserPatternTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_LEGACYNAMESPACEDECLARATION()
-    {
-        $pattern = str_replace('FLUID_NAMESPACE_SEPARATOR', preg_quote(\TYPO3\CMS\Fluid\Fluid::LEGACY_NAMESPACE_SEPARATOR), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_NAMESPACEDECLARATION);
-        $this->assertEquals(preg_match($pattern, '{namespace acme=Tx_AcmeMyPackage_Bla_blubb}'), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (1).');
-        $this->assertEquals(preg_match($pattern, '{namespace acme=Tx_AcmeMyPackage_Bla_Blubb }'), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (2).');
-        $this->assertEquals(preg_match($pattern, '    {namespace foo = Tx_Foo_Bla3_Blubb }    '), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (3).');
-        $this->assertEquals(preg_match($pattern, ' \\{namespace fblubb = Tx_Fluid_Bla3_Blubb }'), 0, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did match a namespace declaration even if it was escaped. (1)');
-        $this->assertEquals(preg_match($pattern, '\\{namespace typo3 = Tx_TYPO3_Bla3_Blubb }'), 0, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did match a namespace declaration even if it was escaped. (2)');
-    }
-
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_NAMESPACEDECLARATION()
-    {
-        $pattern = str_replace('FLUID_NAMESPACE_SEPARATOR', preg_quote(\TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_NAMESPACEDECLARATION);
-        $this->assertEquals(preg_match($pattern, '{namespace acme=Acme.MyPackage\Bla\blubb}'), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (1).');
-        $this->assertEquals(preg_match($pattern, '{namespace acme=Acme.MyPackage\Bla\Blubb }'), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (2).');
-        $this->assertEquals(preg_match($pattern, '    {namespace foo = Foo\Bla3\Blubb }    '), 1, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did not match a namespace declaration (3).');
-        $this->assertEquals(preg_match($pattern, ' \\{namespace fblubb = TYPO3.Fluid\Bla3\Blubb }'), 0, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did match a namespace declaration even if it was escaped. (1)');
-        $this->assertEquals(preg_match($pattern, '\\{namespace typo3 = TYPO3.TYPO3\Bla3\Blubb }'), 0, 'The SCAN_PATTERN_NAMESPACEDECLARATION pattern did match a namespace declaration even if it was escaped. (2)');
-    }
-
-    /**
-     * @test
-     */
-    public function testSPLIT_PATTERN_DYNAMICTAGS()
-    {
-        $pattern = $this->insertNamespaceIntoRegularExpression(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SPLIT_PATTERN_TEMPLATE_DYNAMICTAGS, array('typo3', 't3', 'f'));
-
-        $source = '<html><head> <f:a.testing /> <f:blablubb> {testing}</f4:blz> </t3:hi.jo>';
-        $expected = array('<html><head> ', '<f:a.testing />', ' ', '<f:blablubb>', ' {testing}</f4:blz> ', '</t3:hi.jo>');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly with simple tags.');
-
-        $source = 'hi<f:testing attribute="Hallo>{yep}" nested:attribute="jup" />ja';
-        $expected = array('hi', '<f:testing attribute="Hallo>{yep}" nested:attribute="jup" />', 'ja');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly with  > inside an attribute.');
-
-        $source = 'hi<f:testing attribute="Hallo\\"{yep}" nested:attribute="jup" />ja';
-        $expected = array('hi', '<f:testing attribute="Hallo\\"{yep}" nested:attribute="jup" />', 'ja');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly if a " is inside a double-quoted string.');
-
-        $source = 'hi<f:testing attribute=\'Hallo>{yep}\' nested:attribute="jup" />ja';
-        $expected = array('hi', '<f:testing attribute=\'Hallo>{yep}\' nested:attribute="jup" />', 'ja');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly with single quotes as attribute delimiters.');
-
-        $source = 'hi<f:testing attribute=\'Hallo\\\'{yep}\' nested:attribute="jup" />ja';
-        $expected = array('hi', '<f:testing attribute=\'Hallo\\\'{yep}\' nested:attribute="jup" />', 'ja');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly if \' is inside a single-quoted attribute.');
-
-        $source = 'Hallo <f:testing><![CDATA[<f:notparsed>]]></f:testing>';
-        $expected = array('Hallo ', '<f:testing>', '<![CDATA[<f:notparsed>]]>', '</f:testing>');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly if there is a CDATA section the parser should ignore.');
-
-        $veryLongViewHelper ='<f:form enctype="multipart/form-data" onsubmit="void(0)" onreset="void(0)" action="someAction" arguments="{arg1: \'val1\', arg2: \'val2\'}" controller="someController" package="YourCompanyName.somePackage" subpackage="YourCompanyName.someSubpackage" section="someSection" format="txt" additionalParams="{param1: \'val1\', param2: \'val2\'}" absolute="true" addQueryString="true" argumentsToBeExcludedFromQueryString="{0: \'foo\'}" />';
-        $source = $veryLongViewHelper . 'Begin' . $veryLongViewHelper . 'End';
-        $expected = array($veryLongViewHelper, 'Begin', $veryLongViewHelper, 'End');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly if the VH has lots of arguments.');
-
-        $source = '<f:a.testing data-bar="foo"> <f:a.testing>';
-        $expected = array('<f:a.testing data-bar="foo">', ' ', '<f:a.testing>');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_DYNAMICTAGS pattern did not split the input string correctly with data- attribute.');
-    }
-
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_DYNAMICTAG()
-    {
-        $pattern = $this->insertNamespaceIntoRegularExpression(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG, array('f'));
-        $source = '<f:crop attribute="Hallo">';
-        $expected = array(
-            0 => '<f:crop attribute="Hallo">',
-            'NamespaceIdentifier' => 'f',
-            1 => 'f',
-            'MethodIdentifier' => 'crop',
-            2 => 'crop',
-            'Attributes' => ' attribute="Hallo"',
-            3 => ' attribute="Hallo"',
-            'Selfclosing' => '',
-            4 => ''
-        );
-        preg_match($pattern, $source, $matches);
-        $this->assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly.');
-
-        $pattern = $this->insertNamespaceIntoRegularExpression(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG, array('f'));
-        $source = '<f:crop data-attribute="Hallo">';
-        $expected = array(
-            0 => '<f:crop data-attribute="Hallo">',
-            'NamespaceIdentifier' => 'f',
-            1 => 'f',
-            'MethodIdentifier' => 'crop',
-            2 => 'crop',
-            'Attributes' => ' data-attribute="Hallo"',
-            3 => ' data-attribute="Hallo"',
-            'Selfclosing' => '',
-            4 => ''
-        );
-        preg_match($pattern, $source, $matches);
-        $this->assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with data- attributes.');
-
-        $source = '<f:base />';
-        $expected = array(
-            0 => '<f:base />',
-            'NamespaceIdentifier' => 'f',
-            1 => 'f',
-            'MethodIdentifier' => 'base',
-            2 => 'base',
-            'Attributes' => '',
-            3 => '',
-            'Selfclosing' => '/',
-            4 => '/'
-        );
-        preg_match($pattern, $source, $matches);
-        $this->assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly when there is a space before the self-closing tag.');
-
-        $source = '<f:crop attribute="Ha\\"llo"/>';
-        $expected = array(
-            0 => '<f:crop attribute="Ha\\"llo"/>',
-            'NamespaceIdentifier' => 'f',
-            1 => 'f',
-            'MethodIdentifier' => 'crop',
-            2 => 'crop',
-            'Attributes' => ' attribute="Ha\\"llo"',
-            3 => ' attribute="Ha\\"llo"',
-            'Selfclosing' => '/',
-            4 => '/'
-        );
-        preg_match($pattern, $source, $matches);
-        $this->assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with self-closing tags.');
-
-        $source = '<f:link.uriTo complex:attribute="Ha>llo" a="b" c=\'d\'/>';
-        $expected = array(
-            0 => '<f:link.uriTo complex:attribute="Ha>llo" a="b" c=\'d\'/>',
-            'NamespaceIdentifier' => 'f',
-            1 => 'f',
-            'MethodIdentifier' => 'link.uriTo',
-            2 => 'link.uriTo',
-            'Attributes' => ' complex:attribute="Ha>llo" a="b" c=\'d\'',
-            3 => ' complex:attribute="Ha>llo" a="b" c=\'d\'',
-            'Selfclosing' => '/',
-            4 => '/'
-        );
-        preg_match($pattern, $source, $matches);
-        $this->assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with complex attributes and > inside the attributes.');
-    }
-
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_CLOSINGDYNAMICTAG()
-    {
-        $pattern = $this->insertNamespaceIntoRegularExpression(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG, array('f'));
-        $this->assertEquals(preg_match($pattern, '</f:bla>'), 1, 'The SCAN_PATTERN_CLOSINGDYNAMICTAG does not match a tag it should match.');
-        $this->assertEquals(preg_match($pattern, '</f:bla.a    >'), 1, 'The SCAN_PATTERN_CLOSINGDYNAMICTAG does not match a tag (with spaces included) it should match.');
-        $this->assertEquals(preg_match($pattern, '</t:bla>'), 0, 'The SCAN_PATTERN_CLOSINGDYNAMICTAG does match match a tag it should not match.');
-    }
-
-    /**
-     * @test
-     */
-    public function testSPLIT_PATTERN_TAGARGUMENTS()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SPLIT_PATTERN_TAGARGUMENTS;
-        $source = ' test="Hallo" argument:post="\'Web" other=\'Single"Quoted\' data-foo="bar"';
-        $this->assertEquals(preg_match_all($pattern, $source, $matches, PREG_SET_ORDER), 4, 'The SPLIT_PATTERN_TAGARGUMENTS does not match correctly.');
-        $this->assertEquals('data-foo', $matches[3]['Argument']);
-    }
-
-    /**
-     * @test
-     */
-    public function testSPLIT_PATTERN_SHORTHANDSYNTAX()
-    {
-        $pattern = $this->insertNamespaceIntoRegularExpression(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SPLIT_PATTERN_SHORTHANDSYNTAX, array('f'));
-
-        $source = 'some string{Object.bla}here as well';
-        $expected = array('some string', '{Object.bla}', 'here as well');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with a simple example.');
-
-        $source = 'some {}string\\{Object.bla}here as well';
-        $expected = array('some {}string\\', '{Object.bla}','here as well');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example. (1)');
-
-        $source = 'some {f:viewHelper()} as well';
-        $expected = array('some ', '{f:viewHelper()}', ' as well');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example. (2)');
-
-        $source = 'abc {f:for(arg1: post)} def';
-        $expected = array('abc ', '{f:for(arg1: post)}', ' def');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example.(3)');
-
-        $source = 'abc {bla.blubb->f:for(param:42)} def';
-        $expected = array('abc ', '{bla.blubb->f:for(param:42)}', ' def');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example.(4)');
-
-        $source = 'abc {f:for(bla:"post{{")} def';
-        $expected = array('abc ', '{f:for(bla:"post{{")}', ' def');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example.(5)');
-
-        $source = 'abc {f:for(param:"abc\\"abc")} def';
-        $expected = array('abc ', '{f:for(param:"abc\\"abc")}', ' def');
-        $this->assertEquals(preg_split($pattern, $source, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY), $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX pattern did not split the input string correctly with an escaped example.(6)');
-    }
-
-    /**
-     * @test
-     */
-    public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER;
-
-        $source = 'f:for(each: bla)';
-        $expected = array(
-            0 => array(
-                0 => 'f:for(each: bla)',
-                1 => 'f',
-                'NamespaceIdentifier' => 'f',
-                2 => 'for',
-                'MethodIdentifier' => 'for',
-                3 => 'each: bla',
-                'ViewHelperArguments' => 'each: bla'
-            )
-        );
-        preg_match_all($pattern, $source, $matches, PREG_SET_ORDER);
-        $this->assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER');
-
-        $source = 'f:for(each: bla)->g:bla(a:"b\\"->(f:a()", cd: {a:b})';
-        $expected = array(
-            0 => array(
-                0 => 'f:for(each: bla)',
-                1 => 'f',
-                'NamespaceIdentifier' => 'f',
-                2 => 'for',
-                'MethodIdentifier' => 'for',
-                3 => 'each: bla',
-                'ViewHelperArguments' => 'each: bla'
-            ),
-            1 => array(
-                0 => 'g:bla(a:"b\\"->(f:a()", cd: {a:b})',
-                1 => 'g',
-                'NamespaceIdentifier' => 'g',
-                2 => 'bla',
-                'MethodIdentifier' => 'bla',
-                3 => 'a:"b\\"->(f:a()", cd: {a:b}',
-                'ViewHelperArguments' => 'a:"b\\"->(f:a()", cd: {a:b}'
-            )
-        );
-        preg_match_all($pattern, $source, $matches, PREG_SET_ORDER);
-        $this->assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER');
-    }
-
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS;
-        $this->assertEquals(preg_match($pattern, '{object}'), 1, 'Object accessor not identified!');
-        $this->assertEquals(preg_match($pattern, '{oBject1}'), 1, 'Object accessor not identified if there is a number and capitals inside!');
-        $this->assertEquals(preg_match($pattern, '{object.recursive}'), 1, 'Object accessor not identified if there is a dot inside!');
-        $this->assertEquals(preg_match($pattern, '{object-with-dash.recursive_value}'), 1, 'Object accessor not identified if there is a _ or - inside!');
-        $this->assertEquals(preg_match($pattern, '{f:for()}'), 1, 'Object accessor not identified if it contains only of a ViewHelper.');
-        $this->assertEquals(preg_match($pattern, '{f:for()->f:for2()}'), 1, 'Object accessor not identified if it contains only of a ViewHelper (nested).');
-        $this->assertEquals(preg_match($pattern, '{abc->f:for()}'), 1, 'Object accessor not identified if there is a ViewHelper inside!');
-        $this->assertEquals(preg_match($pattern, '{bla-blubb.recursive_value->f:for()->f:for()}'), 1, 'Object accessor not identified if there is a recursive ViewHelper inside!');
-        $this->assertEquals(preg_match($pattern, '{f:for(arg1:arg1value, arg2: "bla\\"blubb")}'), 1, 'Object accessor not identified if there is an argument inside!');
-        $this->assertEquals(preg_match($pattern, '{dash:value}'), 0, 'Object accessor identified, but was array!');
-        //$this->assertEquals(preg_match($pattern, '{}'), 0, 'Object accessor identified, and it was empty!');
-    }
-
-    /**
-     * @test
-     */
-    public function testSCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS;
-        $this->assertEquals(preg_match($pattern, '{a:b}'), 1, 'Array syntax not identified!');
-        $this->assertEquals(preg_match($pattern, '{a:b, c :   d}'), 1, 'Array syntax not identified in case there are multiple properties!');
-        $this->assertEquals(preg_match($pattern, '{a : 123}'), 1, 'Array syntax not identified when a number is passed as argument!');
-        $this->assertEquals(preg_match($pattern, '{a:"String"}'), 1, 'Array syntax not identified in case of a double quoted string!');
-        $this->assertEquals(preg_match($pattern, '{a:\'String\'}'), 1, 'Array syntax not identified in case of a single quoted string!');
-
-        $expected = '{a:{bla:{x:z}, b: a}}';
-        preg_match($pattern, $expected, $match);
-        $this->assertEquals($match[0], $expected, 'If nested arrays appear, the string is not parsed correctly.');
-
-        $expected = '{a:"{bla{{}"}';
-        preg_match($pattern, $expected, $match);
-        $this->assertEquals($match[0], $expected, 'If nested strings with {} inside appear, the string is not parsed correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function testSPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS;
-
-        $source = '{a: b, e: {c:d, e:f}}';
-        preg_match_all($pattern, $source, $matches, PREG_SET_ORDER);
-
-        $expected = array(
-            0 => array(
-                0 => 'a: b',
-                'ArrayPart' => 'a: b',
-                1 => 'a: b',
-                'Key' => 'a',
-                2 => 'a',
-                'QuotedString' => '',
-                3 => '',
-                'VariableIdentifier' => 'b',
-                4 => 'b'
-            ),
-            1 => array(
-                0 => 'e: {c:d, e:f}',
-                'ArrayPart' => 'e: {c:d, e:f}',
-                1 => 'e: {c:d, e:f}',
-                'Key' => 'e',
-                2 => 'e',
-                'QuotedString' => '',
-                3 => '',
-                'VariableIdentifier' => '',
-                4 => '',
-                'Number' => '',
-                5 => '',
-                'Subarray' => 'c:d, e:f',
-                6 => 'c:d, e:f'
-            )
-        );
-        $this->assertEquals($matches, $expected, 'The regular expression splitting the array apart does not work!');
-    }
-
-    /**
-     * Test the SCAN_PATTERN_CDATA which should detect <![CDATA[...]]> (with no leading or trailing spaces!)
-     *
-     * @test
-     */
-    public function testSCAN_PATTERN_CDATA()
-    {
-        $pattern = \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::$SCAN_PATTERN_CDATA;
-        $this->assertEquals(preg_match($pattern, '<!-- Test -->'), 0, 'The SCAN_PATTERN_CDATA matches a comment, but it should not.');
-        $this->assertEquals(preg_match($pattern, '<![CDATA[This is some ]]>'), 1, 'The SCAN_PATTERN_CDATA does not match a simple CDATA string.');
-        $this->assertEquals(preg_match($pattern, '<![CDATA[This is<bla:test> some ]]>'), 1, 'The SCAN_PATTERN_CDATA does not match a CDATA string with tags inside..');
-    }
-
-    /**
-     * Helper method which replaces NAMESPACE in the regular expression with the real namespace used.
-     *
-     * @param string $regularExpression The regular expression in which to replace NAMESPACE
-     * @param array $namespace List of namespace identifiers.
-     * @return string working regular expression with NAMESPACE replaced.
-     */
-    protected function insertNamespaceIntoRegularExpression($regularExpression, $namespace)
-    {
-        return str_replace('NAMESPACE', implode('|', $namespace), $regularExpression);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
deleted file mode 100644
index 6142f65ade6f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
+++ /dev/null
@@ -1,1131 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-use TYPO3\CMS\Core\Tests\AccessibleObjectInterface;
-use TYPO3\CMS\Fluid\Core\Parser\TemplateParser;
-
-/**
- * Testcase for TemplateParser.
- *
- * This is to at least half a system test, as it compares rendered results to
- * expectations, and does not strictly check the parsing...
- */
-class TemplateParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function parseThrowsExceptionWhenStringArgumentMissing()
-    {
-        $templateParser = new \TYPO3\CMS\Fluid\Core\Parser\TemplateParser();
-        $templateParser->parse(123);
-    }
-
-    /**
-     * @test
-     */
-    public function extractNamespaceDefinitionsExtractsNamespacesCorrectly()
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_call('extractNamespaceDefinitions', ' \\{namespace f4=F7\\Rocks} {namespace f4=TYPO3\Rocks\Really}');
-        $expected = array(
-            'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
-            'f4' => 'TYPO3\Rocks\Really'
-        );
-        $this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
-    }
-
-    /**
-     * @test
-     */
-    public function extractNamespaceDefinitionsExtractsXmlNamespacesCorrectly()
-    {
-        $mockSettings = array(
-            'namespaces' => array(
-                'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace',
-                'http://otherdomain.tld/ns/other/viewhelpers' => 'My\Other\Namespace'
-            )
-        );
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->injectSettings($mockSettings);
-        $templateParser->_call('extractNamespaceDefinitions', 'Some content <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f5="http://domain.tld/ns/my/viewhelpers"
-		xmlns:xyz="http://otherdomain.tld/ns/other/viewhelpers" />');
-        $expected = array(
-            'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
-            'f5' => 'My\Namespace',
-            'xyz' => 'My\Other\Namespace'
-        );
-        $this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
-    }
-
-    /**
-     * @test
-     */
-    public function extractNamespaceDefinitionsResolveNamespacesWithDefaultPattern()
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_call('extractNamespaceDefinitions', '<xml xmlns="http://www.w3.org/1999/xhtml" xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers" />');
-        $expected = array(
-            'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
-            'xyz' => 'Some\Package\ViewHelpers'
-        );
-        $this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
-    }
-
-    /**
-     * @test
-     */
-    public function extractNamespaceDefinitionsSilentlySkipsXmlNamespaceDeclarationsThatCantBeResolved()
-    {
-        $mockSettings = array(
-            'namespaces' => array(
-                'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
-            )
-        );
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->injectSettings($mockSettings);
-        $templateParser->_call('extractNamespaceDefinitions', '<xml xmlns="http://www.w3.org/1999/xhtml" xmlns:f5="http://domain.tld/ns/my/viewhelpers"
-		xmlns:xyz="http://otherdomain.tld/ns/other/viewhelpers" />');
-        $expected = array(
-            'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
-            'f5' => 'My\Namespace'
-        );
-        $this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
-    }
-
-    /**
-     * @test
-     */
-    public function extractNamespaceDefinitionsSilentlySkipsXmlNamespaceDeclarationForTheDefaultFluidNamespace()
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_call('extractNamespaceDefinitions', '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://domain.tld/this/will/be/ignored" />');
-        $expected = array(
-            'f' => \TYPO3\CMS\Fluid\ViewHelpers::class
-        );
-        $this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function extractNamespaceDefinitionsThrowsExceptionIfNamespaceIsRedeclared()
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_call('extractNamespaceDefinitions', '{namespace typo3=TYPO3\CMS\Fluid\Blablubb} {namespace typo3= TYPO3\Rocks\Blu}');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function extractNamespaceDefinitionsThrowsExceptionIfXmlNamespaceIsRedeclaredAsFluidNamespace()
-    {
-        $mockSettings = array(
-            'namespaces' => array(
-                'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
-            )
-        );
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->injectSettings($mockSettings);
-        $templateParser->_call('extractNamespaceDefinitions', '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:typo3="http://domain.tld/ns/my/viewhelpers" />{namespace typo3=TYPO3\CMS\Fluid\Blablubb}');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function extractNamespaceDefinitionsThrowsExceptionIfFluidNamespaceIsRedeclaredAsXmlNamespace()
-    {
-        $mockSettings = array(
-            'namespaces' => array(
-                'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
-            )
-        );
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->injectSettings($mockSettings);
-        $templateParser->_call('extractNamespaceDefinitions', '{namespace typo3=TYPO3\CMS\Fluid\Blablubb} <foo xmlns="http://www.w3.org/1999/xhtml" xmlns:typo3="http://domain.tld/ns/my/viewhelpers" />');
-    }
-
-    /**
-     * @param array $expectedFoundIdentifiers
-     * @param string $templateString
-     * @param array $namespaces
-     * @test
-     * @dataProvider extractNamespaceDefinitionsCallsRemoveXmlnsViewHelperNamespaceDeclarationsWithCorrectFoundIdentifiersDataProvider
-     */
-    public function extractNamespaceDefinitionsCallsRemoveXmlnsViewHelperNamespaceDeclarationsWithCorrectFoundIdentifiers(array $expectedFoundIdentifiers, $templateString, array $namespaces)
-    {
-        $mockSettings = array(
-            'namespaces' => $namespaces
-        );
-
-        /** @var TemplateParser|\PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface $templateParser */
-        $templateParser = $this->getAccessibleMock(TemplateParser::class, array('removeXmlnsViewHelperNamespaceDeclarations'));
-        $templateParser->injectSettings($mockSettings);
-
-        // this verifies that the method is called with the correct found identifiers
-        // and also that the templateString was not modified before calling removeXmlnsViewHelperNamespaceDeclarations
-        $templateParser
-            ->expects($this->once())
-            ->method('removeXmlnsViewHelperNamespaceDeclarations')
-            ->with($templateString, $expectedFoundIdentifiers)
-            ->willReturnArgument(0);
-        $templateParser->_call('extractNamespaceDefinitions', $templateString);
-    }
-
-    /**
-     * @return array
-     */
-    public function extractNamespaceDefinitionsCallsRemoveXmlnsViewHelperNamespaceDeclarationsWithCorrectFoundIdentifiersDataProvider()
-    {
-        return [
-            'bothViewHelperNamespacesDefinitionsOnlyProvideXmlnsViewHelpersUsingNonDefaultPatternViewHelpers' => array(
-                ['foo'],
-                '{namespace typo3=TYPO3\\CMS\\Fluid\\Blablubb} <div xmlns:foo="http://domain.tld/ns/foo/viewhelpers">Content</div>',
-                ['http://domain.tld/ns/foo/viewhelpers' => 'My\\Namespace']
-            ),
-            'bothViewHelperNamespacesDefinitionsOnlyProvideXmlnsViewHelpersUsingDefaultPatternViewHelpers' => array(
-                ['xyz'],
-                '{namespace typo3=TYPO3\\CMS\\Fluid\\Blablubb} <div xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers">Content</div>',
-                []
-            ),
-            'xmlnsIdentifiersWithWhitespaces' => array(
-                [' ', 'foo bar', '"x y z"'],
-                '
-					<div xmlns: ="http://typo3.org/ns/Some/Package/ViewHelpers"
-							xmlns:foo bar="http://domain.tld/ns/foobar/viewhelpers"
-							xmlns:"x y z"="http://typo3.org/ns/My/Xyz/ViewHelpers">
-
-						Content
-					</div>
-				',
-                ['http://domain.tld/ns/foobar/viewhelpers' => 'My\\Namespace']
-            ),
-            'xmlnsWithEqualsSign' => array(
-                ['=', 'foo=bar', '"x=y=z"'],
-                '
-					<div xmlns:=="http://typo3.org/ns/Some/Package/ViewHelpers"
-							xmlns:foo=bar="http://domain.tld/ns/foobar/viewhelpers"
-							xmlns:"x=y=z"="http://typo3.org/ns/My/Xyz/ViewHelpers">
-
-						Content
-					</div>
-				',
-                ['http://domain.tld/ns/foobar/viewhelpers' => 'My\\Namespace']
-            ),
-            'nonViewHelpersXmlnsAreNotIncludedButDefaultPatternAndNonDefaultAreIncluded' => array(
-                ['xyz', 'foo'],
-                '<div xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers"
-						xmlns:foo="http://domain.tld/ns/foo/viewhelpers"
-						xmlns:bar="http://typo3.org/foo/bar">
-
-					Content
-				</div>',
-                ['http://domain.tld/ns/foo/viewhelpers' => 'My\\Namespace']
-            ),
-            'nonViewHelpersInBetweenViewHelperXmlnsAreNotIncludedButDefaultPatternAndNonDefaultAreIncluded' => array(
-                ['xyz', 'foo'],
-                '<div xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers"
-							xmlns:bar="http://typo3.org/foo/bar"
-							xmlns:foo="http://domain.tld/ns/foo/viewhelpers">
-
-					Content
-				</div>',
-                ['http://domain.tld/ns/foo/viewhelpers' => 'My\\Namespace']
-            ),
-            'fluidNamespaceIsFound' => array(
-                ['f'],
-                '<div xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">Content</div>',
-                []
-            ),
-            'xmlnsWithoutIdentifierIsIgnored' => array(
-                [],
-                '<div xmlns="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">Content</div>',
-                []
-            ),
-            'htmlTagAlsoFindsIdentifiers' => array(
-                ['f', 'xyz'],
-                '<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-								xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers">
-
-					Content
-				</html>',
-                []
-            ),
-            'htmlTagWithNamespaceTypo3FluidAttributeTagAlsoFindsIdentifiers' => array(
-                ['f', 'xyz'],
-                '<html data-namespace-typo3-fluid="true"
-					xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-					xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers">
-
-					Content
-				</html>',
-                []
-            ),
-            'nonHtmlTagAlsoFindsIdentifiers' => array(
-                ['f', 'xyz'],
-                '<typo3-root
-					xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-					xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers">
-
-					Content
-				</typo3-root>',
-                []
-            ),
-        ];
-    }
-
-    /**
-     * @param string $expectedOut
-     * @param string $templateString
-     * @param array $foundIdentifiers
-     * @test
-     * @dataProvider removeXmlnsViewHelperNamespaceDeclarationsDataProvider
-     */
-    public function removeXmlnsViewHelperNamespaceDeclarationsWorks($expectedOut, array $foundIdentifiers, $templateString)
-    {
-        $templateParser = $this->getAccessibleMock(TemplateParser::class, array('dummy'));
-        $templateString = $templateParser->_call('removeXmlnsViewHelperNamespaceDeclarations', $templateString, $foundIdentifiers);
-
-        // remove tabs and trim because expected result and given have a different tab count in dataProvider which is not relevant for the parser (xml and html)
-        $this->assertSame(trim(str_replace("\t", '', $expectedOut)), trim(str_replace("\t", '', $templateString)));
-    }
-
-    /**
-     * DataProvider for removeXmlnsViewHelperNamespaceDeclarationsWorks test
-     *
-     * @return array
-     */
-    public function removeXmlnsViewHelperNamespaceDeclarationsDataProvider()
-    {
-        return [
-            'onlyViewHelperXmlns' => array(
-                '
-					<div >
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe'],
-                '<div xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers">
-					<f:if condition="{demo}">Hello World</f:if>
-				</div>'
-            ),
-            'xmlnsViewHelpersFoundWithNonViewHelperXmlnsAtBeginning' => array(
-                '
-					<div xmlns:z="http://www.typo3.org/foo" >
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe'],
-                '
-					<div xmlns:z="http://www.typo3.org/foo"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsViewHelpersFoundWithNonViewHelperXmlnsAtEnd' => array(
-                '
-					<div xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsViewHelpersFoundWithMultipleNonViewHelperXmlns' => array(
-                '
-					<div xmlns:y="http://www.typo3.org/bar" xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:y="http://www.typo3.org/bar"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsViewHelpersFoundWithNonViewHelperXmlnsBetween' => array(
-                '
-					<div xmlns:z="http://www.typo3.org/foo" >
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['fe', 'f'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'removeHtmlTagWithAttributeButNoXmlnsViewHelpersFound' => array(
-                '<f:if condition="{demo}">Hello World</f:if>',
-                [],
-                '
-					<html data-namespace-typo3-fluid="true">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				'
-            ),
-            'doNotRemoveHtmlTagBecauseHtmlTagNotMarkedAsFluidNamespaceDefinitionTag' => array(
-                '
-					<html xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				',
-                ['fe', 'f'],
-                '
-					<html xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				'
-            ),
-            'doNotModifyHtmlTagBecauseViewHelperXmlnsNotFoundInTagAndNotMarkedForRemoval' => array(
-                '
-					<html xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				',
-                ['f'], // required because without any found namespaces the method will not do any replacements
-                '
-					<html xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				'
-            ),
-            'removeHtmlTagBecauseXmlnsFoundInTagAndMarkedAsFluidViewHelperDefinitionTag' => array(
-                '<f:if condition="{demo}">Hello World</f:if>',
-                ['fe'],
-                '
-					<html data-namespace-typo3-fluid="true"
-							xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				'
-            ),
-            'removeHtmlTagBecauseXmlnsFoundInDifferentTagAndMarkedAsFluidViewHelperDefinitionTag' => array(
-                '<f:if condition="{demo}">Hello World</f:if>',
-                ['f'],
-                '
-					<html data-namespace-typo3-fluid="true" xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</html>
-				'
-            ),
-            'producesExcpedtedOutputIfFouundIdentifiersAreWrongButContainNoExistingNonViewHelperXmlns' => array(
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers" xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'i'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            // this test verifies that the expected output can be wrong if the foundNameSpaces are incorrect
-            // which is why extractNamespaceDefinitionsCallsRemoveXmlnsViewHelperNamespaceDeclarationsWithCorrectFoundIdentifiers
-            // tests if the correct identifiers are found
-            'removesNonViewHelperNamespaceIfFoundIdentifiersAreWrong' => array(
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers" >
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'z'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            // this verifies that the scan pattern was correctly quoted for the regular expression
-            // because if the regular expression delimiter were to be modified in the pattern,
-            // the corresponding preg_quote will fail without adaptions
-            'xmlnsWithScanPatternAsIdentifier' => array(
-                '
-					<div >
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                [TemplateParser::$SCAN_PATTERN_REMOVE_VIEWHELPERS_XMLNSDECLARATIONS],
-                '
-					<div xmlns:' . TemplateParser::$SCAN_PATTERN_REMOVE_VIEWHELPERS_XMLNSDECLARATIONS . '="http://typo3.org/ns/TYPO3/CMS\Demo/ViewHelpers">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            // these scenarios also need to because even if the foundIdentifiers are
-            // invalid the method should still work as expected,
-            // Furthermore, currently these patterns are allowed for foundIdentifiers
-            // see also test extractNamespaceDefinitionsCallsRemoveXmlnsViewHelperNamespaceDeclarationsWithCorrectFoundIdentifiers
-            'xmlnsIdentifiersWithWhitespaces' => array(
-                '
-					<div xmlns:none xyz="http://domain.tld/ns/NoneXyz/viewhelpers" >
-
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                [' ', 'foo bar', '"x y z"'],
-                '
-					<div xmlns: ="http://typo3.org/ns/Some/Package/ViewHelpers"
-							xmlns:foo bar="http://domain.tld/ns/foobar/viewhelpers"
-							xmlns:none xyz="http://domain.tld/ns/NoneXyz/viewhelpers"
-							xmlns:"x y z"="http://typo3.org/ns/My/Xyz/ViewHelpers">
-
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsWithRegularExpressionAsIdentifier' => array(
-                '
-					<div xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe', '.*.?\\s'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:.*.?\\s="http://typo3.org/ns/TYPO3/CMS\Demo/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsWithRegularExpressionDelimiterAsIdentifier' => array(
-                '
-					<div xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['f', 'fe', '/'],
-                '
-					<div xmlns:fe="http://typo3.org/ns/TYPO3/CMS/Frontend/ViewHelpers"
-							xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
-							xmlns:/="http://typo3.org/ns/TYPO3/CMS\Demo/ViewHelpers"
-							xmlns:z="http://www.typo3.org/foo">
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            ),
-            'xmlnsWithEqualsSign' => array(
-                '
-					<div xmlns:none=xyz="http://domain.tld/ns/NoneXyz/viewhelpers" >
-
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				',
-                ['=', 'foo=bar', '"x=y=z"'],
-                '
-					<div xmlns:=="http://typo3.org/ns/Some/Package/ViewHelpers"
-							xmlns:foo=bar="http://domain.tld/ns/foobar/viewhelpers"
-							xmlns:none=xyz="http://domain.tld/ns/NoneXyz/viewhelpers"
-							xmlns:"x=y=z"="http://typo3.org/ns/My/Xyz/ViewHelpers">
-
-						<f:if condition="{demo}">Hello World</f:if>
-					</div>
-				'
-            )
-        ];
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperNameWithMultipleLevelsCanBeResolvedByResolveViewHelperName()
-    {
-        $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'), array(), '', false);
-        $result = $mockTemplateParser->_call('resolveViewHelperName', 'f', 'foo.bar.baz');
-        $expected = 'TYPO3\CMS\Fluid\ViewHelpers\Foo\Bar\BazViewHelper';
-        $this->assertEquals($expected, $result, 'The name of the View Helper Name could not be resolved.');
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperNameWithOneLevelCanBeResolvedByResolveViewHelperName()
-    {
-        $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'), array(), '', false);
-        $actual = $mockTemplateParser->_call('resolveViewHelperName', 'f', 'myown');
-        $expected = 'TYPO3\CMS\Fluid\ViewHelpers\MyownViewHelper';
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     */
-    public function quotedStrings()
-    {
-        return array(
-            array('"no quotes here"', 'no quotes here'),
-            array("'no quotes here'", 'no quotes here'),
-            array("'this \"string\" had \\'quotes\\' in it'", 'this "string" had \'quotes\' in it'),
-            array('"this \\"string\\" had \'quotes\' in it"', 'this "string" had \'quotes\' in it'),
-            array('"a weird \"string\" \'with\' *freaky* \\\\stuff', 'a weird "string" \'with\' *freaky* \\stuff'),
-            array('\'\\\'escaped quoted string in string\\\'\'', '\'escaped quoted string in string\'')
-        );
-    }
-
-    /**
-     * @dataProvider quotedStrings
-     * @test
-     */
-    public function unquoteStringReturnsUnquotedStrings($quoted, $unquoted)
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $this->assertEquals($unquoted, $templateParser->_call('unquoteString', $quoted));
-    }
-
-    /**
-     */
-    public function templatesToSplit()
-    {
-        return array(
-            array('TemplateParserTestFixture01-shorthand'),
-            array('TemplateParserTestFixture06'),
-            array('TemplateParserTestFixture14')
-        );
-    }
-
-    /**
-     * @dataProvider templatesToSplit
-     * @test
-     */
-    public function splitTemplateAtDynamicTagsReturnsCorrectlySplitTemplate($templateName)
-    {
-        $template = file_get_contents(__DIR__ . '/Fixtures/' . $templateName . '.html', FILE_TEXT);
-        $expectedResult = require(__DIR__ . '/Fixtures/' . $templateName . '-split.php');
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $this->assertSame($expectedResult, $templateParser->_call('splitTemplateAtDynamicTags', $template), 'Filed for ' . $templateName);
-    }
-
-    /**
-     * @test
-     */
-    public function buildObjectTreeCreatesRootNodeAndSetsUpParsingState()
-    {
-        $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('setRootNode')->with($mockRootNode);
-        $mockState->expects($this->once())->method('pushNodeToStack')->with($mockRootNode);
-        $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function buildObjectTreeThrowsExceptionIfOpenTagsRemain()
-    {
-        $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(2));
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
-    }
-
-    /**
-     * @test
-     */
-    public function buildObjectTreeDelegatesHandlingOfTemplateElements()
-    {
-        $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('textHandler', 'openingViewHelperTagHandler', 'closingViewHelperTagHandler', 'textAndShorthandSyntaxHandler'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->expects($this->at(0))->method('textAndShorthandSyntaxHandler')->with($mockState, 'The first part is simple');
-        $templateParser->expects($this->at(1))->method('textHandler')->with($mockState, '<f:for each="{a: {a: 0, b: 2, c: 4}}" as="array"><f:for each="{array}" as="value">{value} </f:for>');
-        $templateParser->expects($this->at(2))->method('openingViewHelperTagHandler')->with($mockState, 'f', 'format.printf', ' arguments="{number : 362525200}"', false);
-        $templateParser->expects($this->at(3))->method('textAndShorthandSyntaxHandler')->with($mockState, '%.3e');
-        $templateParser->expects($this->at(4))->method('closingViewHelperTagHandler')->with($mockState, 'f', 'format.printf');
-        $templateParser->expects($this->at(5))->method('textAndShorthandSyntaxHandler')->with($mockState, 'and here goes some {text} that could have {shorthand}');
-
-        $splitTemplate = $templateParser->_call('splitTemplateAtDynamicTags', 'The first part is simple<![CDATA[<f:for each="{a: {a: 0, b: 2, c: 4}}" as="array"><f:for each="{array}" as="value">{value} </f:for>]]><f:format.printf arguments="{number : 362525200}">%.3e</f:format.printf>and here goes some {text} that could have {shorthand}');
-        $templateParser->_call('buildObjectTree', $splitTemplate, \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
-    }
-
-    /**
-     * @test
-     */
-    public function openingViewHelperTagHandlerDelegatesViewHelperInitialization()
-    {
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->never())->method('popNodeFromStack');
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('parseArguments', 'initializeViewHelperAndAddItToStack'));
-        $templateParser->expects($this->once())->method('parseArguments')->with(array('arguments'))->will($this->returnValue(array('parsedArguments')));
-        $templateParser->expects($this->once())->method('initializeViewHelperAndAddItToStack')->with($mockState, 'namespaceIdentifier', 'methodIdentifier', array('parsedArguments'));
-
-        $templateParser->_call('openingViewHelperTagHandler', $mockState, 'namespaceIdentifier', 'methodIdentifier', array('arguments'), false);
-    }
-
-    /**
-     * @test
-     */
-    public function openingViewHelperTagHandlerPopsNodeFromStackForSelfClosingTags()
-    {
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class)));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('parseArguments', 'initializeViewHelperAndAddItToStack'));
-
-        $templateParser->_call('openingViewHelperTagHandler', $mockState, '', '', array(), true);
-    }
-
-    /**
-     * @test
-     */
-    public function initializeViewHelperAndAddItToStackCreatesRequestedViewHelperAndViewHelperNode()
-    {
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-        $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', false);
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
-        $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
-
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-        $mockState->expects($this->once())->method('pushNodeToStack')->with($mockViewHelperNode);
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-
-        $templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
-    }
-
-    /**
-     * @test
-     */
-    public function initializeViewHelperAndAddItToStackChecksViewHelperArguments()
-    {
-        $expectedArguments = array('expectedArguments');
-        $argumentsObjectTree = array('arguments');
-
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
-        $mockViewHelper->expects($this->once())->method('prepareArguments')->will($this->returnValue($expectedArguments));
-        $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', false);
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
-
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->expects($this->once())->method('abortIfUnregisteredArgumentsExist')->with($expectedArguments, $argumentsObjectTree);
-        $templateParser->expects($this->once())->method('abortIfRequiredArgumentsAreMissing')->with($expectedArguments, $argumentsObjectTree);
-
-        $templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', $argumentsObjectTree);
-    }
-
-    /**
-     * @test
-     */
-    public function initializeViewHelperAndAddItToStackHandlesPostParseFacets()
-    {
-        $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\PostParseFacetViewHelper::class, array('prepareArguments'));
-        $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', false);
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
-        $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-        $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
-
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-        $mockState->expects($this->once())->method('getVariableContainer')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class)));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-
-        $templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
-        $this->assertTrue(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\PostParseFacetViewHelper::$wasCalled, 'PostParse was not called!');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function abortIfUnregisteredArgumentsExistThrowsExceptionOnUnregisteredArguments()
-    {
-        $expected = array(new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('firstArgument', 'string', '', false));
-        $actual = array('firstArgument' => 'foo', 'secondArgument' => 'bar');
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $templateParser->_call('abortIfUnregisteredArgumentsExist', $expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function abortIfUnregisteredArgumentsExistDoesNotThrowExceptionIfEverythingIsOk()
-    {
-        $expectedArguments = array(
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('name1', 'string', 'desc', false),
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('name2', 'string', 'desc', true)
-        );
-        $actualArguments = array(
-            'name1' => 'bla'
-        );
-
-        $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $mockTemplateParser->_call('abortIfUnregisteredArgumentsExist', $expectedArguments, $actualArguments);
-        // dummy assertion to avoid "did not perform any assertions" error
-        $this->assertTrue(true);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function abortIfRequiredArgumentsAreMissingThrowsException()
-    {
-        $expected = array(
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('firstArgument', 'string', '', false),
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('secondArgument', 'string', '', true)
-        );
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $templateParser->_call('abortIfRequiredArgumentsAreMissing', $expected, array());
-    }
-
-    /**
-     * @test
-     */
-    public function abortIfRequiredArgumentsAreMissingDoesNotThrowExceptionIfRequiredArgumentExists()
-    {
-        $expectedArguments = array(
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('name1', 'string', 'desc', false),
-            new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('name2', 'string', 'desc', true)
-        );
-        $actualArguments = array(
-            'name2' => 'bla'
-        );
-
-        $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $mockTemplateParser->_call('abortIfRequiredArgumentsAreMissing', $expectedArguments, $actualArguments);
-        // dummy assertion to avoid "did not perform any assertions" error
-        $this->assertTrue(true);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function closingViewHelperTagHandlerThrowsExceptionBecauseOfClosingTagWhichWasNeverOpened()
-    {
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class, array(), array(), '', false);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $templateParser->_call('closingViewHelperTagHandler', $mockState, 'f', 'method');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
-     */
-    public function closingViewHelperTagHandlerThrowsExceptionBecauseOfWrongTagNesting()
-    {
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', false);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-
-        $templateParser->_call('closingViewHelperTagHandler', $mockState, 'f', 'method');
-    }
-
-    /**
-     * @test
-     */
-    public function objectAccessorHandlerCallsInitializeViewHelperAndAddItToStackIfViewHelperSyntaxIsPresent()
-    {
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->exactly(2))->method('popNodeFromStack')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class)));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('recursiveArrayHandler', 'postProcessArgumentsForObjectAccessor', 'initializeViewHelperAndAddItToStack'));
-        $templateParser->expects($this->at(0))->method('recursiveArrayHandler')->with('format: "H:i"')->will($this->returnValue(array('format' => 'H:i')));
-        $templateParser->expects($this->at(1))->method('postProcessArgumentsForObjectAccessor')->with(array('format' => 'H:i'))->will($this->returnValue(array('processedArguments')));
-        $templateParser->expects($this->at(2))->method('initializeViewHelperAndAddItToStack')->with($mockState, 'f', 'format.date', array('processedArguments'));
-        $templateParser->expects($this->at(3))->method('initializeViewHelperAndAddItToStack')->with($mockState, 'f', 'base', array());
-
-        $templateParser->_call('objectAccessorHandler', $mockState, '', '', 'f:base() f:format.date(format: "H:i")', '');
-    }
-
-    /**
-     * @test
-     */
-    public function objectAccessorHandlerCreatesObjectAccessorNodeWithExpectedValueAndAddsItToStack()
-    {
-        $objectAccessorNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', false);
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', false);
-        $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($objectAccessorNode);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-
-        $templateParser->_call('objectAccessorHandler', $mockState, 'objectAccessorString', '', '', '');
-    }
-
-    /**
-     * @test
-     */
-    public function valuesFromObjectAccessorsAreRunThroughValueInterceptorsByDefault()
-    {
-        $objectAccessorNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', false);
-        $objectAccessorNodeInterceptor = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::class);
-        $objectAccessorNodeInterceptor->expects($this->once())->method('process')->with($objectAccessorNode)->will($this->returnArgument(0));
-
-        $parserConfiguration = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\Configuration::class);
-        $parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR)->will($this->returnValue(array($objectAccessorNodeInterceptor)));
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->once())->method('get')->will($this->returnValue($objectAccessorNode));
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', false);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->_set('configuration', $parserConfiguration);
-
-        $templateParser->_call('objectAccessorHandler', $mockState, 'objectAccessorString', '', '', '');
-    }
-
-    /**
-     */
-    public function argumentsStrings()
-    {
-        return array(
-            array('a="2"', array('a' => '2')),
-            array('a="2" b="foobar \' with \\" quotes"', array('a' => '2', 'b' => 'foobar \' with " quotes')),
-            array(' arguments="{number : 362525200}"', array('arguments' => '{number : 362525200}'))
-        );
-    }
-
-    /**
-     * @test
-     * @dataProvider argumentsStrings
-     * @param string $argumentsString
-     * @param array $expected
-     */
-    public function parseArgumentsWorksAsExpected($argumentsString, array $expected)
-    {
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('buildArgumentObjectTree'));
-        $templateParser->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
-
-        $this->assertSame($expected, $templateParser->_call('parseArguments', $argumentsString));
-    }
-
-    /**
-     * @test
-     */
-    public function buildArgumentObjectTreeReturnsTextNodeForSimplyString()
-    {
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, 'a very plain string')->will($this->returnValue('theTextNode'));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-
-        $this->assertEquals('theTextNode', $templateParser->_call('buildArgumentObjectTree', 'a very plain string'));
-    }
-
-    /**
-     * @test
-     */
-    public function buildArgumentObjectTreeBuildsObjectTreeForComlexString()
-    {
-        $objectTree = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $objectTree->expects($this->once())->method('getRootNode')->will($this->returnValue('theRootNode'));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('splitTemplateAtDynamicTags', 'buildObjectTree'));
-        $templateParser->expects($this->at(0))->method('splitTemplateAtDynamicTags')->with('a <very> {complex} string')->will($this->returnValue('split string'));
-        $templateParser->expects($this->at(1))->method('buildObjectTree')->with('split string')->will($this->returnValue($objectTree));
-
-        $this->assertEquals('theRootNode', $templateParser->_call('buildArgumentObjectTree', 'a <very> {complex} string'));
-    }
-
-    /**
-     * @test
-     */
-    public function textAndShorthandSyntaxHandlerDelegatesAppropriately()
-    {
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('objectAccessorHandler', 'arrayHandler', 'textHandler'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->expects($this->at(0))->method('objectAccessorHandler')->with($mockState, 'someThing.absolutely', '', '', '');
-        $templateParser->expects($this->at(1))->method('textHandler')->with($mockState, ' "fishy" is \'going\' ');
-        $templateParser->expects($this->at(2))->method('arrayHandler')->with($mockState, 'on: "here"');
-
-        $text = '{someThing.absolutely} "fishy" is \'going\' {on: "here"}';
-        $templateParser->_call('textAndShorthandSyntaxHandler', $mockState, $text, \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS);
-    }
-
-    /**
-     * @test
-     */
-    public function arrayHandlerAddsArrayNodeWithProperContentToStack()
-    {
-        $arrayNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, array(), array(array()));
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', false);
-        $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($arrayNode);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, 'processedArrayText')->will($this->returnValue($arrayNode));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('recursiveArrayHandler'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->expects($this->once())->method('recursiveArrayHandler')->with('arrayText')->will($this->returnValue('processedArrayText'));
-
-        $templateParser->_call('arrayHandler', $mockState, 'arrayText');
-    }
-
-    /**
-     */
-    public function arrayTexts()
-    {
-        return array(
-            array(
-                'key1: "foo", key2: \'bar\', key3: someVar, key4: 123, key5: { key6: "baz" }',
-                array('key1' => 'foo', 'key2' => 'bar', 'key3' => 'someVar', 'key4' => 123.0, 'key5' => array('key6' => 'baz'))
-            ),
-            array(
-                'key1: "\'foo\'", key2: \'\\\'bar\\\'\'',
-                array('key1' => '\'foo\'', 'key2' => '\'bar\'')
-            )
-        );
-    }
-
-    /**
-     * @test
-     * @dataProvider arrayTexts
-     */
-    public function recursiveArrayHandlerReturnsExpectedArray($arrayText, $expectedArray)
-    {
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('buildArgumentObjectTree'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
-
-        $this->assertSame($expectedArray, $templateParser->_call('recursiveArrayHandler', $arrayText));
-    }
-
-    /**
-     * @test
-     */
-    public function textNodesAreRunThroughTextInterceptors()
-    {
-        $textNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', false);
-        $textInterceptor = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::class);
-        $textInterceptor->expects($this->once())->method('process')->with($textNode)->will($this->returnArgument(0));
-
-        $parserConfiguration = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\Configuration::class);
-        $parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_TEXT)->will($this->returnValue(array($textInterceptor)));
-
-        $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, 'string')->will($this->returnValue($textNode));
-
-        $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', false);
-        $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($textNode);
-        $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
-        $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
-
-        $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('splitTemplateAtDynamicTags', 'buildObjectTree'));
-        $templateParser->_set('objectManager', $mockObjectManager);
-        $templateParser->_set('configuration', $parserConfiguration);
-
-        $templateParser->_call('textHandler', $mockState, 'string');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextFixture.php b/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextFixture.php
new file mode 100644
index 000000000000..827e7449c260
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextFixture.php
@@ -0,0 +1,29 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
+
+/**
+ * Fixture for RenderingContext
+ */
+class RenderingContextFixture extends RenderingContext
+{
+    /**
+     * Replacement NOOP constructor
+     */
+    public function __construct()
+    {
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php
index a615dc12af16..a9034a772258 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php
@@ -1,15 +1,20 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
+use TYPO3\CMS\Extbase\Mvc\Request;
 
 /**
  * Test case
@@ -25,7 +30,31 @@ class RenderingContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     protected function setUp()
     {
-        $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
+        $this->renderingContext = $this->getAccessibleMock(RenderingContextFixture::class, array('dummy'));
+    }
+
+    /**
+     * @test
+     */
+    public function getObjectManagerReturnsObjectManagerPropertyValue()
+    {
+        $this->renderingContext->_set('objectManager', 'test');
+        $this->assertEquals('test', $this->renderingContext->getObjectManager());
+    }
+
+    /**
+     * @test
+     */
+    public function setControllerContextWithSubpackageKeySetsExpectedControllerContext()
+    {
+        $renderingContext = $this->getMock(RenderingContextFixture::class, array('setControllerAction', 'setControllerName'));
+        $request = $this->getMock(Request::class, array('getControllerActionName', 'getControllerSubpackageKey', 'getControllerName'));
+        $request->expects($this->exactly(2))->method('getControllerSubpackageKey')->willReturn('test1');
+        $request->expects($this->once())->method('getControllerName')->willReturn('test2');
+        $controllerContext = $this->getMock(ControllerContext::class, array('getRequest'));
+        $controllerContext->expects($this->once())->method('getRequest')->willReturn($request);
+        $renderingContext->expects($this->once())->method('setControllerName')->with('test1\\test2');
+        $renderingContext->setControllerContext($controllerContext);
     }
 
     /**
@@ -34,7 +63,7 @@ class RenderingContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function templateVariableContainerCanBeReadCorrectly()
     {
         $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
-        $this->renderingContext->injectTemplateVariableContainer($templateVariableContainer);
+        $this->renderingContext->setVariableProvider($templateVariableContainer);
         $this->assertSame($this->renderingContext->getTemplateVariableContainer(), $templateVariableContainer, 'Template Variable Container could not be read out again.');
     }
 
@@ -43,7 +72,11 @@ class RenderingContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function controllerContextCanBeReadCorrectly()
     {
-        $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
+        $controllerContext = $this->getMock(
+            \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class,
+            array('getRequest'), array(), '', false
+        );
+        $controllerContext->expects($this->atLeastOnce())->method('getRequest')->willReturn($this->getMock(Request::class));
         $this->renderingContext->setControllerContext($controllerContext);
         $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
     }
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Variables/CmsVariableProviderTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Variables/CmsVariableProviderTest.php
new file mode 100644
index 000000000000..804c5f70905f
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Variables/CmsVariableProviderTest.php
@@ -0,0 +1,32 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Variables;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\Core\Variables\CmsVariableProvider;
+
+/**
+ * Test case
+ */
+class CmsVariableProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
+{
+    /**
+     * @test
+     */
+    public function getByPathDelegatesToObjectAccess()
+    {
+        $instance = new CmsVariableProvider();
+        $instance->setSource(array('foo' => 'bar'));
+        $this->assertEquals('bar', $instance->getByPath('foo'));
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractConditionViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractConditionViewHelperTest.php
deleted file mode 100644
index 416e2eb0047c..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractConditionViewHelperTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for Condition ViewHelper
- */
-class AbstractConditionViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper
-     */
-    protected $viewHelper;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\Arguments
-     */
-    protected $mockArguments;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper::class, array('getRenderingContext', 'renderChildren', 'hasArgument'));
-        $this->viewHelper->expects($this->any())->method('getRenderingContext')->will($this->returnValue($this->renderingContext));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-    }
-
-    /**
-     * @test
-     */
-    public function renderThenChildReturnsAllChildrenIfNoThenViewHelperChildExists()
-    {
-        $this->viewHelper->expects($this->any())->method('renderChildren')->will($this->returnValue('foo'));
-
-        $actualResult = $this->viewHelper->_call('renderThenChild');
-        $this->assertEquals('foo', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderThenChildReturnsThenViewHelperChildIfConditionIsTrueAndThenViewHelperChildExists()
-    {
-        $mockThenViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate'), array(), '', false);
-        $mockThenViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper::class));
-        $mockThenViewHelperNode->expects($this->at(1))->method('evaluate')->with($this->renderingContext)->will($this->returnValue('ThenViewHelperResults'));
-
-        $this->viewHelper->setChildNodes(array($mockThenViewHelperNode));
-        $actualResult = $this->viewHelper->_call('renderThenChild');
-        $this->assertEquals('ThenViewHelperResults', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderElseChildReturnsEmptyStringIfConditionIsFalseAndNoElseViewHelperChildExists()
-    {
-        $actualResult = $this->viewHelper->_call('renderElseChild');
-        $this->assertEquals('', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderElseChildRendersElseViewHelperChildIfConditionIsFalseAndNoThenViewHelperChildExists()
-    {
-        $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', false);
-        $mockElseViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
-        $mockElseViewHelperNode->expects($this->at(1))->method('evaluate')->with($this->renderingContext)->will($this->returnValue('ElseViewHelperResults'));
-
-        $this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
-        $actualResult = $this->viewHelper->_call('renderElseChild');
-        $this->assertEquals('ElseViewHelperResults', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderThenChildReturnsValueOfThenArgumentIfConditionIsTrue()
-    {
-        $this->arguments['then'] = 'ThenArgument';
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-
-        $actualResult = $this->viewHelper->_call('renderThenChild');
-        $this->assertEquals('ThenArgument', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderThenChildReturnsEmptyStringIfChildNodesOnlyContainElseViewHelper()
-    {
-        $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate'), array(), '', false);
-        $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
-        $this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
-        $this->viewHelper->expects($this->never())->method('renderChildren')->will($this->returnValue('Child nodes'));
-
-        $actualResult = $this->viewHelper->_call('renderThenChild');
-        $this->assertEquals('', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function thenArgumentHasPriorityOverChildNodesIfConditionIsTrue()
-    {
-        $mockThenViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', false);
-        $mockThenViewHelperNode->expects($this->never())->method('evaluate');
-
-        $this->viewHelper->setChildNodes(array($mockThenViewHelperNode));
-
-        $this->arguments['then'] = 'ThenArgument';
-
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-
-        $actualResult = $this->viewHelper->_call('renderThenChild');
-        $this->assertEquals('ThenArgument', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsValueOfElseArgumentIfConditionIsFalse()
-    {
-        $this->arguments['else'] = 'ElseArgument';
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-
-        $actualResult = $this->viewHelper->_call('renderElseChild');
-        $this->assertEquals('ElseArgument', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function elseArgumentHasPriorityOverChildNodesIfConditionIsFalse()
-    {
-        $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', false);
-        $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
-        $mockElseViewHelperNode->expects($this->never())->method('evaluate');
-
-        $this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
-
-        $this->arguments['else'] = 'ElseArgument';
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-
-        $actualResult = $this->viewHelper->_call('renderElseChild');
-        $this->assertEquals('ElseArgument', $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractTagBasedViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractTagBasedViewHelperTest.php
deleted file mode 100644
index c2e731c08059..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractTagBasedViewHelperTest.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class AbstractTagBasedViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('dummy'), array(), '', false);
-    }
-
-    /**
-     * @test
-     */
-    public function initializeResetsUnderlyingTagBuilder()
-    {
-        $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('reset'), array(), '', false);
-        $mockTagBuilder->expects($this->once())->method('reset');
-        $this->viewHelper->_set('tag', $mockTagBuilder);
-
-        $this->viewHelper->initialize();
-    }
-
-    /**
-     * @test
-     */
-    public function oneTagAttributeIsRenderedCorrectly()
-    {
-        $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', false);
-        $mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
-        $this->viewHelper->_set('tag', $mockTagBuilder);
-
-        $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', false);
-        $arguments = array('foo' => 'bar');
-        $this->viewHelper->setArguments($arguments);
-        $this->viewHelper->initialize();
-    }
-
-    /**
-     * @test
-     */
-    public function additionalTagAttributesAreRenderedCorrectly()
-    {
-        $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', false);
-        $mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
-        $this->viewHelper->_set('tag', $mockTagBuilder);
-
-        $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', false);
-        $arguments = array('additionalAttributes' => array('foo' => 'bar'));
-        $this->viewHelper->setArguments($arguments);
-        $this->viewHelper->initialize();
-    }
-
-    /**
-     * @test
-     */
-    public function dataAttributesAreRenderedCorrectly()
-    {
-        $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', false);
-        $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('data-foo', 'bar');
-        $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('data-baz', 'foos');
-        $this->viewHelper->_set('tag', $mockTagBuilder);
-
-        $arguments = array('data' => array('foo' => 'bar', 'baz' => 'foos'));
-        $this->viewHelper->setArguments($arguments);
-        $this->viewHelper->initializeArguments();
-        $this->viewHelper->initialize();
-    }
-
-    /**
-     * @test
-     */
-    public function standardTagAttributesAreRegistered()
-    {
-        $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', false);
-        $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('class', 'classAttribute');
-        $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('dir', 'dirAttribute');
-        $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('id', 'idAttribute');
-        $mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('lang', 'langAttribute');
-        $mockTagBuilder->expects($this->at(4))->method('addAttribute')->with('style', 'styleAttribute');
-        $mockTagBuilder->expects($this->at(5))->method('addAttribute')->with('title', 'titleAttribute');
-        $mockTagBuilder->expects($this->at(6))->method('addAttribute')->with('accesskey', 'accesskeyAttribute');
-        $mockTagBuilder->expects($this->at(7))->method('addAttribute')->with('tabindex', 'tabindexAttribute');
-        $this->viewHelper->_set('tag', $mockTagBuilder);
-
-        $arguments = array(
-            'class' => 'classAttribute',
-            'dir' => 'dirAttribute',
-            'id' => 'idAttribute',
-            'lang' => 'langAttribute',
-            'style' => 'styleAttribute',
-            'title' => 'titleAttribute',
-            'accesskey' => 'accesskeyAttribute',
-            'tabindex' => 'tabindexAttribute'
-        );
-        $this->viewHelper->_call('registerUniversalTagAttributes');
-        $this->viewHelper->setArguments($arguments);
-        $this->viewHelper->initializeArguments();
-        $this->viewHelper->initialize();
-    }
-
-    /**
-     * @test
-     */
-    public function registerTagAttributeRegistersArgumentWithDefaultValue()
-    {
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('registerArgument'), array(), '', false);
-        $this->viewHelper->expects($this->once())->method('registerArgument')->with('foo', 'string', 'Description', false, 'defaultValue');
-        $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', false, 'defaultValue');
-    }
-
-    /**
-     * @test
-     */
-    public function registerTagAttributeRegistersArgumentWithNullIfNoDefaultValueIsSet()
-    {
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('registerArgument'), array(), '', false);
-        $this->viewHelper->expects($this->once())->method('registerArgument')->with('foo', 'string', 'Description', false, null);
-        $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', false);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php
index c28bdac3dfb6..aa183895153f 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php
@@ -1,15 +1,23 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Extbase\Mvc\Request;
+use TYPO3\CMS\Extbase\Reflection\ReflectionService;
+use TYPO3\CMS\Fluid\Core\Exception;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
 
 /**
  * Test case
@@ -63,6 +71,103 @@ class AbstractViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->mockReflectionService = $this->getMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class, array(), array(), '', false);
     }
 
+    /**
+     * @test
+     * @dataProvider getCallRenderMethodTestValues
+     * @param array $arguments
+     * @param bool $expectsException
+     */
+    public function registerRenderMethodArgumentsThrowsExceptionOnMissingType(array $arguments, $expectsException = false)
+    {
+        $reflectionService = $this->getMock(ReflectionService::class, array('getMethodParameters', 'getMethodTagsValues'));
+        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
+            array(
+                'param1' => array(
+                    'position' => 0,
+                    'byReference' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                )
+            )
+        );
+        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn(array());
+        $fixture = $this->getAccessibleMock(TestViewHelper::class, array('render'));
+        $fixture->injectReflectionService($reflectionService);
+        $this->setExpectedException(Exception::class);
+        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
+    }
+
+    /**
+     * @test
+     * @dataProvider getCallRenderMethodTestValues
+     * @param array $arguments
+     * @param bool $expectsException
+     */
+    public function callRenderMethodBehavesAsExpected(array $arguments, $expectsException = false)
+    {
+        $reflectionService = $this->getMock(ReflectionService::class, array('getMethodParameters', 'getMethodTagsValues'));
+        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
+            array(
+                'param1' => array(
+                    'position' => 0,
+                    'type' => 'integer',
+                    'byReference' => false,
+                    'array' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                ),
+                'param2' => array(
+                    'position' => 1,
+                    'type' => 'array',
+                    'byReference' => false,
+                    'array' => true,
+                    'optional' => false,
+                    'allowsNull' => true
+                ),
+                'param3' => array(
+                    'position' => 2,
+                    'type' => 'string',
+                    'byReference' => false,
+                    'array' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                ),
+            )
+        );
+        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn(
+            array()
+        );
+        $fixture = $this->getAccessibleMock(TestViewHelper::class, array('render'));
+        $namedArguments = array_combine(array('param1', 'param2', 'param3'), $arguments);
+        $fixture->injectReflectionService($reflectionService);
+        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
+        $fixture->setArguments($namedArguments);
+        if ($expectsException) {
+            $exception = new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception('test');
+            $this->setExpectedException(get_class($exception));
+            $fixture->expects($this->once())->method('render')->willThrowException($exception);
+            $this->assertEquals('test', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
+        } else {
+            $fixture->expects($this->once())
+                ->method('render')
+                ->with($arguments[0], $arguments[1], $arguments[2])
+                ->willReturn('okay');
+            $this->assertEquals('okay', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
+        }
+    }
+
+    /**
+     * @return array
+     */
+    public function getCallRenderMethodTestValues()
+    {
+        return array(
+            array(array(3, array('bar'), 'baz'), false),
+            array(array(2, array('baz'), 'bar'), false),
+            array(array(3, array('bar'), 'baz'), true),
+        );
+    }
+
     /**
      * @test
      */
@@ -149,8 +254,6 @@ class AbstractViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function prepareArgumentsRegistersAnnotationBasedArgumentsWithDescriptionIfDebugModeIsEnabled()
     {
-        \TYPO3\CMS\Fluid\Fluid::$debugMode = true;
-
         $dataCacheMock = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, array(), array(), '', false);
         $dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(true));
         $dataCacheMock->expects($this->any())->method('get')->will($this->returnValue(array()));
@@ -168,34 +271,6 @@ class AbstractViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         );
 
         $this->assertEquals($expected, $viewHelper->prepareArguments(), 'Annotation based arguments were not registered.');
-
-        \TYPO3\CMS\Fluid\Fluid::$debugMode = false;
-    }
-
-    /**
-     * @test
-     */
-    public function prepareArgumentsRegistersAnnotationBasedArgumentsWithoutDescriptionIfDebugModeIsDisabled()
-    {
-        \TYPO3\CMS\Fluid\Fluid::$debugMode = false;
-
-        $dataCacheMock = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, array(), array(), '', false);
-        $dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(true));
-        $dataCacheMock->expects($this->any())->method('get')->will($this->returnValue(array()));
-
-        $viewHelper = new \TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper2();
-
-        $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper2::class, 'render')->will($this->returnValue($this->fixtureMethodParameters));
-        $this->mockReflectionService->expects($this->never())->method('getMethodTagsValues');
-        $viewHelper->injectReflectionService($this->mockReflectionService);
-
-        $expected = array(
-            'param1' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param1', 'integer', '', true, null, true),
-            'param2' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param2', 'array', '', true, null, true),
-            'param3' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param3', 'string', '', false, 'default', true)
-        );
-
-        $this->assertEquals($expected, $viewHelper->prepareArguments(), 'Annotation based arguments were not registered.');
     }
 
     /**
@@ -280,10 +355,12 @@ class AbstractViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
         $viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
-        $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
+        $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array('getRequest'), array(), '', false);
+        $controllerContext->expects($this->atLeastOnce())->method('getRequest')->willReturn($this->getMock(Request::class));
 
-        $renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
-        $renderingContext->injectTemplateVariableContainer($templateVariableContainer);
+        $renderingContext = $this->getAccessibleMock(RenderingContextFixture::class, array('getControllerContext'));
+        $renderingContext->expects($this->any())->method('getControllerContext')->willReturn($controllerContext);
+        $renderingContext->setVariableProvider($templateVariableContainer);
         $renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
         $renderingContext->setControllerContext($controllerContext);
 
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ArgumentDefinitionTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ArgumentDefinitionTest.php
index 85d8df7ffae5..43d986859f43 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ArgumentDefinitionTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ArgumentDefinitionTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test case
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TagBuilderTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TagBuilderTest.php
deleted file mode 100644
index cb6f7263d76e..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TagBuilderTest.php
+++ /dev/null
@@ -1,228 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class TagBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @test
-     */
-    public function constructorSetsTagName()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('someTagName');
-        $this->assertEquals('someTagName', $tagBuilder->getTagName());
-    }
-
-    /**
-     * @test
-     */
-    public function constructorSetsTagContent()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('', '<some text>');
-        $this->assertEquals('<some text>', $tagBuilder->getContent());
-    }
-
-    /**
-     * @test
-     */
-    public function setContentDoesNotEscapeValue()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder();
-        $tagBuilder->setContent('<to be escaped>', false);
-        $this->assertEquals('<to be escaped>', $tagBuilder->getContent());
-    }
-
-    /**
-     * @test
-     */
-    public function hasContentReturnsTrueIfTagContainsText()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('', 'foo');
-        $this->assertTrue($tagBuilder->hasContent());
-    }
-
-    /**
-     * @test
-     */
-    public function hasContentReturnsFalseIfContentIsNull()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder();
-        $tagBuilder->setContent(null);
-        $this->assertFalse($tagBuilder->hasContent());
-    }
-
-    /**
-     * @test
-     */
-    public function hasContentReturnsFalseIfContentIsAnEmptyString()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder();
-        $tagBuilder->setContent('');
-        $this->assertFalse($tagBuilder->hasContent());
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsEmptyStringByDefault()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder();
-        $this->assertEquals('', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsSelfClosingTagIfNoContentIsSpecified()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $this->assertEquals('<tag />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function contentCanBeRemoved()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag', 'some content');
-        $tagBuilder->setContent(null);
-        $this->assertEquals('<tag />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsOpeningAndClosingTagIfNoContentIsSpecifiedButForceClosingTagIsTrue()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->forceClosingTag(true);
-        $this->assertEquals('<tag></tag>', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function attributesAreProperlyRendered()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->addAttribute('attribute1', 'attribute1value');
-        $tagBuilder->addAttribute('attribute2', 'attribute2value');
-        $tagBuilder->addAttribute('attribute3', 'attribute3value');
-        $this->assertEquals('<tag attribute1="attribute1value" attribute2="attribute2value" attribute3="attribute3value" />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function attributeValuesAreEscapedByDefault()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->addAttribute('foo', '<to be escaped>');
-        $this->assertEquals('<tag foo="&lt;to be escaped&gt;" />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function attributeValuesAreNotEscapedIfDisabled()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->addAttribute('foo', '<not to be escaped>', false);
-        $this->assertEquals('<tag foo="<not to be escaped>" />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function attributesCanBeRemoved()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->addAttribute('attribute1', 'attribute1value');
-        $tagBuilder->addAttribute('attribute2', 'attribute2value');
-        $tagBuilder->addAttribute('attribute3', 'attribute3value');
-        $tagBuilder->removeAttribute('attribute2');
-        $this->assertEquals('<tag attribute1="attribute1value" attribute3="attribute3value" />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function attributesCanBeAccessed()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $tagBuilder->addAttribute('attribute1', 'attribute1value');
-        $attributeValue = $tagBuilder->getAttribute('attribute1');
-        $this->assertSame('attribute1value', $attributeValue);
-    }
-
-    /**
-     * @test
-     */
-    public function getAttributeWithMissingAttributeReturnsNull()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('tag');
-        $attributeValue = $tagBuilder->getAttribute('missingattribute');
-        $this->assertNull($attributeValue);
-    }
-
-    /**
-     * @test
-     */
-    public function resetResetsTagBuilder()
-    {
-        $tagBuilder = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('dummy'));
-        $tagBuilder->setTagName('tagName');
-        $tagBuilder->setContent('some content');
-        $tagBuilder->forceClosingTag(true);
-        $tagBuilder->addAttribute('attribute1', 'attribute1value');
-        $tagBuilder->addAttribute('attribute2', 'attribute2value');
-        $tagBuilder->reset();
-
-        $this->assertEquals('', $tagBuilder->_get('tagName'));
-        $this->assertEquals('', $tagBuilder->_get('content'));
-        $this->assertEquals(array(), $tagBuilder->_get('attributes'));
-        $this->assertFalse($tagBuilder->_get('forceClosingTag'));
-    }
-
-    /**
-     * @test
-     */
-    public function tagNameCanBeOverridden()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('foo');
-        $tagBuilder->setTagName('bar');
-        $this->assertEquals('<bar />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function tagContentCanBeOverridden()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('foo', 'some content');
-        $tagBuilder->setContent('');
-        $this->assertEquals('<foo />', $tagBuilder->render());
-    }
-
-    /**
-     * @test
-     */
-    public function tagIsNotRenderedIfTagNameIsEmpty()
-    {
-        $tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder('foo');
-        $tagBuilder->setTagName('');
-        $this->assertEquals('', $tagBuilder->render());
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TemplateVariableContainerTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TemplateVariableContainerTest.php
deleted file mode 100644
index 7888d34205d7..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TemplateVariableContainerTest.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class TemplateVariableContainerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
-     */
-    protected $variableContainer;
-
-    protected function setUp()
-    {
-        $this->variableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
-    }
-
-    /**
-     * @test
-     */
-    public function addedObjectsCanBeRetrievedAgain()
-    {
-        $object = 'StringObject';
-        $this->variableContainer->add('variable', $object);
-        $this->assertSame($this->variableContainer->get('variable'), $object, 'The retrieved object from the context is not the same as the stored object.');
-    }
-
-    /**
-     * @test
-     */
-    public function addedObjectsCanBeRetrievedAgainUsingArrayAccess()
-    {
-        $object = 'StringObject';
-        $this->variableContainer['variable'] = $object;
-        $this->assertSame($this->variableContainer->get('variable'), $object);
-        $this->assertSame($this->variableContainer['variable'], $object);
-    }
-
-    /**
-     * @test
-     */
-    public function addedObjectsExistInArray()
-    {
-        $object = 'StringObject';
-        $this->variableContainer->add('variable', $object);
-        $this->assertTrue($this->variableContainer->exists('variable'));
-        $this->assertTrue(isset($this->variableContainer['variable']));
-    }
-
-    /**
-     * @test
-     */
-    public function addedObjectsExistInAllIdentifiers()
-    {
-        $object = 'StringObject';
-        $this->variableContainer->add('variable', $object);
-        $this->assertEquals($this->variableContainer->getAllIdentifiers(), array('variable'), 'Added key is not visible in getAllIdentifiers');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function duplicateIdentifiersThrowException()
-    {
-        $this->variableContainer->add('variable', 'string1');
-        $this->variableContainer['variable'] = 'string2';
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function addingReservedIdentifiersThrowException()
-    {
-        $this->variableContainer->add('TrUe', 'someValue');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function gettingNonexistentValueThrowsException()
-    {
-        $this->variableContainer->get('nonexistent');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function deletingNonexistentValueThrowsException()
-    {
-        $this->variableContainer->remove('nonexistent');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function removeReallyRemovesVariables()
-    {
-        $this->variableContainer->add('variable', 'string1');
-        $this->variableContainer->remove('variable');
-        $this->variableContainer->get('variable');
-    }
-
-    /**
-     * @test
-     */
-    public function whenVariablesAreEmpty_getAll_shouldReturnEmptyArray()
-    {
-        $this->assertSame(array(), $this->variableContainer->get('_all'));
-    }
-
-    /**
-     * @test
-     */
-    public function getAllShouldReturnAllVariables()
-    {
-        $this->variableContainer->add('name', 'Simon');
-        $this->assertSame(array('name' => 'Simon'), $this->variableContainer->get('_all'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function addingVariableNamedAllShouldThrowException()
-    {
-        $this->variableContainer->add('_all', 'foo');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php
new file mode 100644
index 000000000000..7be28d174536
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php
@@ -0,0 +1,63 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver;
+use TYPO3\CMS\Fluid\ViewHelpers\CObjectViewHelper;
+use TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesViewHelper;
+use TYPO3Fluid\Fluid\ViewHelpers\RenderViewHelper;
+
+/**
+ * Test case
+ */
+class ViewHelperResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
+{
+    /**
+     * @test
+     */
+    public function createViewHelperInstanceCreatesViewHelperInstanceUsingObjectManager()
+    {
+        $objectManager = $this->getMock(ObjectManager::class, array('get'), array(), '', false);
+        $objectManager->expects($this->once())->method('get')->with('x')->willReturn('y');
+        $resolver = $this->getMock(ViewHelperResolver::class, array('getObjectManager'));
+        $resolver->expects($this->once())->method('getObjectManager')->willReturn($objectManager);
+        $this->assertEquals('y', $resolver->createViewHelperInstanceFromClassName('x'));
+    }
+
+    /**
+     * @test
+     * @dataProvider getResolveViewHelperNameTestValues
+     * @param string $namespace
+     * @param string $method
+     * @param string $expected
+     */
+    public function resolveViewHelperClassNameResolvesExpectedViewHelperClassName($namespace, $method, $expected)
+    {
+        $viewHelperResolver = new ViewHelperResolver();
+        $this->assertEquals($expected, $viewHelperResolver->resolveViewHelperClassName($namespace, $method));
+    }
+
+    /**
+     * @return array
+     */
+    public function getResolveViewHelperNameTestValues()
+    {
+        return array(
+            array('f', 'cObject', CObjectViewHelper::class),
+            array('f', 'format.htmlentities', HtmlentitiesViewHelper::class),
+            array('f', 'render', RenderViewHelper::class)
+        );
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperVariableContainerTest.php b/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperVariableContainerTest.php
deleted file mode 100644
index 1c5b44713b01..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperVariableContainerTest.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Test case
- */
-class ViewHelperVariableContainerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
-     */
-    protected $viewHelperVariableContainer;
-
-    protected function setUp()
-    {
-        $this->viewHelperVariableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer();
-    }
-
-    /**
-     * @test
-     */
-    public function storedDataCanBeReadOutAgain()
-    {
-        $variable = 'Hello world';
-        $this->assertFalse($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test', $variable);
-        $this->assertTrue($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
-
-        $this->assertEquals($variable, $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function gettingNonNonExistentValueThrowsException()
-    {
-        $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function settingKeyWhichIsAlreadyStoredThrowsException()
-    {
-        $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey', 'value1');
-        $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey', 'value2');
-    }
-
-    /**
-     * @test
-     */
-    public function addOrUpdateWorks()
-    {
-        $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey', 'value1');
-        $this->viewHelperVariableContainer->addOrUpdate('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey', 'value2');
-        $this->assertEquals($this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey'), 'value2');
-    }
-
-    /**
-     * @test
-     */
-    public function aSetValueCanBeRemovedAgain()
-    {
-        $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey', 'value1');
-        $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey');
-        $this->assertFalse($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
-     */
-    public function removingNonExistentKeyThrowsException()
-    {
-        $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelper\\NonExistent', 'nonExistentKey');
-    }
-
-    /**
-     * @test
-     */
-    public function viewCanBeReadOutAgain()
-    {
-        $view = $this->getMock(\TYPO3\CMS\Fluid\View\AbstractTemplateView::class, array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'hasTemplate', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
-        $this->viewHelperVariableContainer->setView($view);
-        $this->assertSame($view, $this->viewHelperVariableContainer->getView());
-    }
-
-    /**
-     * @test
-     */
-    public function existsReturnsFalseIfTheSpecifiedKeyDoesNotExist()
-    {
-        $this->assertFalse($this->viewHelperVariableContainer->exists('TYPO3\Fluid\ViewHelper\NonExistent', 'nonExistentKey'));
-    }
-
-    /**
-     * @test
-     */
-    public function existsReturnsTrueIfTheSpecifiedKeyExists()
-    {
-        $this->viewHelperVariableContainer->add('TYPO3\Fluid\ViewHelper\NonExistent', 'someKey', 'someValue');
-        $this->assertTrue($this->viewHelperVariableContainer->exists('TYPO3\Fluid\ViewHelper\NonExistent', 'someKey'));
-    }
-
-    /**
-     * @test
-     */
-    public function existsReturnsTrueIfTheSpecifiedKeyExistsAndIsNull()
-    {
-        $this->viewHelperVariableContainer->add('TYPO3\Fluid\ViewHelper\NonExistent', 'someKey', null);
-        $this->assertTrue($this->viewHelperVariableContainer->exists('TYPO3\Fluid\ViewHelper\NonExistent', 'someKey'));
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
index 2311fc560efa..6ca03b2e0a85 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
@@ -1,31 +1,26 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
+/*
+ * 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!
+ */
+use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
+use TYPO3\CMS\Extbase\Mvc\Request;
 use TYPO3\CMS\Extbase\Mvc\ResponseInterface;
 use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController;
 use TYPO3\CMS\Fluid\Core\Widget\WidgetRequest;
+use TYPO3\CMS\Fluid\View\TemplatePaths;
+use TYPO3\CMS\Fluid\View\TemplateView;
 
 /**
  * Test case
@@ -74,29 +69,90 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
+     * @dataProvider getSetViewConfigurationTestValues
+     * @param array $parent
+     * @param array|NULL $widget
+     * @param array $expected
      */
-    public function viewConfigurationCanBeOverriddenThroughFrameworkConfiguration()
+    public function setViewConfigurationPerformsExpectedInitialization(array $parent, $widget, array $expected)
     {
-        $frameworkConfiguration = array(
+        $configurationManager = $this->getMock(ConfigurationManagerInterface::class);
+        $configurationManager->expects($this->once())->method('getConfiguration')->willReturn(array(
             'view' => array(
                 'widget' => array(
-                    \TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper::class => array(
-                        'templateRootPath' => 'EXT:fluid/Resources/Private/DummyTestTemplates'
-                    )
+                    'foobarClassName' => $widget
                 )
             )
+        ));
+        $parentRequest = $this->getMock(Request::class, array('getControllerExtensionKey'));
+        $parentRequest->expects($this->once())->method('getControllerExtensionKey')->willReturn(null);
+        $controllerContext = $this->getMock(ControllerContext::class, array('getRequest'));
+        $controllerContext->expects($this->once())->method('getRequest')->willReturn($parentRequest);
+        $templatePaths = $this->getMock(TemplatePaths::class, array('fillFromConfigurationArray', 'toArray'));
+        $templatePaths->expects($this->once())->method('fillFromConfigurationArray')->with($expected);
+        $templatePaths->expects($this->any())->method('toArray')->willReturn($parent);
+        $widgetContext = $this->getMock(WidgetContext::class, array('getWidgetViewHelperClassName'));
+        $widgetContext->expects($this->once())->method('getWidgetViewHelperClassName')->willReturn('foobarClassName');
+        $request = $this->getMock(Request::class, array('getWidgetContext'));
+        $request->expects($this->once())->method('getWidgetContext')->willReturn($widgetContext);
+
+        $view = $this->getAccessibleMock(TemplateView::class, array('getTemplatePaths', 'toArray'), array(), '', false);
+        $view->expects($this->exactly(2))->method('getTemplatePaths')->willReturn($templatePaths);
+
+        $mock = $this->getAccessibleMock(AbstractWidgetController::class, array('dummy'));
+        $mock->_set('configurationManager', $configurationManager);
+        $mock->_set('controllerContext', $controllerContext);
+        $mock->_set('request', $request);
+        $method = new \ReflectionMethod(AbstractWidgetController::class, 'setViewConfiguration');
+        $method->setAccessible(true);
+        $method->invokeArgs($mock, array($view));
+    }
+
+    /**
+     * @return array
+     */
+    public function getSetViewConfigurationTestValues()
+    {
+        return array(
+            'Empty path sets cause empty widget paths' => array(
+                array(),
+                null,
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array(),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array(),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array()
+                )
+            ),
+            'Parent request paths are reused when not overridden' => array(
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array('foo'),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array('bar'),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array('baz')
+                ),
+                array(),
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array('foo'),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array('bar'),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array('baz')
+                )
+            ),
+            'Widget paths are added to parent paths' => array(
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array('foo1'),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array('bar1'),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array('baz1')
+                ),
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array('foo2'),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array('bar2'),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array('baz2')
+                ),
+                array(
+                    TemplatePaths::CONFIG_TEMPLATEROOTPATHS => array('foo1', 'foo2'),
+                    TemplatePaths::CONFIG_LAYOUTROOTPATHS => array('bar1', 'bar2'),
+                    TemplatePaths::CONFIG_PARTIALROOTPATHS => array('baz1', 'baz2')
+                )
+            ),
         );
-        $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
-        $widgetContext->expects($this->any())->method('getWidgetViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper::class));
-        $request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array(), array(), '', false);
-        $request->expects($this->any())->method('getWidgetContext')->will($this->returnValue($widgetContext));
-        $configurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
-        $configurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($frameworkConfiguration));
-        $view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', false);
-        $abstractWidgetController = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController::class, array('dummy'));
-        $abstractWidgetController->_set('configurationManager', $configurationManager);
-        $abstractWidgetController->_set('request', $request);
-        $abstractWidgetController->_call('setViewConfiguration', $view);
-        $this->assertSame(array(GeneralUtility::getFileAbsFileName('EXT:fluid/Resources/Private/DummyTestTemplates')), $view->_call('getTemplateRootPaths'));
     }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
index 202ffb1c016d..65cd52f5f4e3 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
@@ -1,25 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper;
+use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
+use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
 
 /**
  * Test case
@@ -78,7 +74,9 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->request = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
         $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
         $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
-        $this->viewHelper->_set('controllerContext', $this->controllerContext);
+        $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class, array('getControllerContext'));
+        $this->renderingContext->expects($this->any())->method('getControllerContext')->willReturn($this->controllerContext);
+        $this->viewHelper->_set('renderingContext', $this->renderingContext);
     }
 
     /**
@@ -107,13 +105,16 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function callViewHelper()
     {
         $mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
-        $mockRenderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
+        $mockViewHelperVariableContainer->expects($this->any())->method('get')->willReturnArgument(2);
+        $mockRenderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $mockRenderingContext->expects($this->atLeastOnce())->method('getViewHelperVariableContainer')->will($this->returnValue($mockViewHelperVariableContainer));
+        $mockRenderingContext->expects($this->any())->method('getControllerContext')->willReturn($this->controllerContext);
         $this->viewHelper->setRenderingContext($mockRenderingContext);
         $this->viewHelper->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('Some Widget Configuration'));
         $this->widgetContext->expects($this->once())->method('setWidgetConfiguration')->with('Some Widget Configuration');
         $this->widgetContext->expects($this->once())->method('setWidgetIdentifier')->with('@widget_0');
         $this->viewHelper->_set('controller', new \stdClass());
+        $this->viewHelper->_set('renderingContext', $mockRenderingContext);
         $this->widgetContext->expects($this->once())->method('setControllerObjectName')->with('stdClass');
         $this->viewHelper->expects($this->once())->method('validateArguments');
         $this->viewHelper->expects($this->once())->method('initialize');
@@ -127,10 +128,10 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function setChildNodesAddsChildNodesToWidgetContext()
     {
-        $node1 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
-        $node2 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', false);
-        $node3 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
-        $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
+        $node1 = $this->getMock(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
+        $node2 = $this->getMock(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', false);
+        $node3 = $this->getMock(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
+        $rootNode = $this->getMock(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode::class);
         $rootNode->expects($this->at(0))->method('addChildNode')->with($node1);
         $rootNode->expects($this->at(1))->method('addChildNode')->with($node2);
         $rootNode->expects($this->at(2))->method('addChildNode')->with($node3);
@@ -189,4 +190,29 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         // SubResponse is returned
         $this->assertSame($response, $output);
     }
+
+    /**
+     * @test
+     */
+    public function getWidgetConfigurationReturnsArgumentsProperty()
+    {
+        $viewHelper = $this->getMock(AbstractWidgetViewHelper::class, array('dummy'));
+        $viewHelper->setArguments(array('foo' => 'bar'));
+        $this->assertEquals(array('foo' => 'bar'), $this->callInaccessibleMethod($viewHelper, 'getWidgetConfiguration'));
+    }
+
+    /**
+     * @test
+     */
+    public function compileDisablesTemplateCompiler()
+    {
+        $viewHelper = $this->getMock(AbstractWidgetViewHelper::class, array('dummy'));
+        $node = $this->getMock(ViewHelperNode::class, array('dummy'), array(), '', false);
+        $compiler = $this->getMock(TemplateCompiler::class, array('disable'));
+        $compiler->expects($this->once())->method('disable');
+        $code = ''; // referenced
+        $result = $viewHelper->compile('', '', $code, $node, $compiler);
+        $this->assertEquals('\'\'', $result);
+        $this->assertEquals('', $code);
+    }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AjaxWidgetContextHolderTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AjaxWidgetContextHolderTest.php
index c5c624edd166..d36f3f7eb90c 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AjaxWidgetContextHolderTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AjaxWidgetContextHolderTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test case
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetContextTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetContextTest.php
index 6e3f17d76ce6..a1d19f37509b 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetContextTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetContextTest.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\Core\Widget\WidgetContext;
 
 /**
  * Test case
@@ -39,6 +33,47 @@ class WidgetContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->widgetContext = new \TYPO3\CMS\Fluid\Core\Widget\WidgetContext();
     }
 
+    /**
+     * @test
+     * @dataProvider getSetterGetterTestValues
+     * @param string $name
+     * @param mixed $value
+     */
+    public function getterMethodReturnsValue($name, $value)
+    {
+        $property = new \ReflectionProperty(WidgetContext::class, $name);
+        $property->setAccessible(true);
+        $property->setValue($this->widgetContext, $value);
+        $method = 'get' . ucfirst($name);
+        $this->assertEquals($value, call_user_func_array(array($this->widgetContext, $method), array()));
+    }
+
+    /**
+     * @test
+     * @dataProvider getSetterGetterTestValues
+     * @param string $name
+     * @param mixed $value
+     */
+    public function setterMethodSetsPropertyValue($name, $value)
+    {
+        $method = 'set' . ucfirst($name);
+        call_user_func_array(array($this->widgetContext, $method), array($value));
+        $this->assertAttributeEquals($value, $name, $this->widgetContext);
+    }
+
+    /**
+     * @return array
+     */
+    public function getSetterGetterTestValues()
+    {
+        return array(
+            array('parentPluginNamespace', 'foo-bar'),
+            array('parentExtensionName', 'baz'),
+            array('parentPluginName', 'baz-foo'),
+            array('widgetViewHelperClassName', 'bar-foo'),
+        );
+    }
+
     /**
      * @test
      */
@@ -86,4 +121,18 @@ class WidgetContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->assertSame($viewHelperChildNodes, $this->widgetContext->getViewHelperChildNodes());
         $this->assertSame($renderingContext, $this->widgetContext->getViewHelperChildNodeRenderingContext());
     }
+
+    /**
+     * @test
+     */
+    public function sleepReturnsExpectedPropertyNames()
+    {
+        $this->assertEquals(
+            array(
+                'widgetIdentifier', 'ajaxWidgetIdentifier', 'widgetConfiguration', 'controllerObjectName',
+                'parentPluginNamespace', 'parentExtensionName', 'parentPluginName', 'widgetViewHelperClassName'
+            ),
+            $this->widgetContext->__sleep()
+        );
+    }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
index bddf5ff08c00..7107d5879161 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test case
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php
index e86c0a32b7aa..a26b3084d205 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php
@@ -1,25 +1,24 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Extbase\Mvc\Dispatcher;
+use TYPO3\CMS\Extbase\Mvc\Web\Request;
+use TYPO3\CMS\Extbase\Mvc\Web\Response;
+use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
+use TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder;
+use TYPO3\CMS\Fluid\Core\Widget\WidgetRequestHandler;
 
 /**
  * Test case
@@ -65,4 +64,23 @@ class WidgetRequestHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $defaultWebRequestHandler = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHandler::class, array('handleRequest'), array(), '', false);
         $this->assertTrue($this->widgetRequestHandler->getPriority() > $defaultWebRequestHandler->getPriority());
     }
+
+    /**
+     * @test
+     */
+    public function handleRequestCallsExpectedMethods()
+    {
+        $handler = new WidgetRequestHandler();
+        $request = $this->getMock(Request::class);
+        $requestBuilder = $this->getMock(WidgetRequestBuilder::class, array('build'));
+        $requestBuilder->expects($this->once())->method('build')->willReturn($request);
+        $objectManager = $this->getMock(ObjectManagerInterface::class);
+        $objectManager->expects($this->once())->method('get')->willReturn($this->getMock(Response::class));
+        $requestDispatcher = $this->getMock(Dispatcher::class, array('dispatch'), array(), '', false);
+        $requestDispatcher->expects($this->once())->method('dispatch')->with($request);
+        $this->inject($handler, 'requestBuilder', $requestBuilder);
+        $this->inject($handler, 'dispatcher', $requestDispatcher);
+        $this->inject($handler, 'objectManager', $objectManager);
+        $handler->handleRequest();
+    }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestTest.php
index 426c5798b4d0..58c5e86862dd 100644
--- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test case
@@ -38,6 +31,19 @@ class WidgetRequestTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $widgetRequest->setWidgetContext($widgetContext);
     }
 
+    /**
+     * @test
+     */
+    public function getArgumentPrefixReadsVariablesFromWidgetContext()
+    {
+        $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class, array('getParentPluginNamespace', 'getWidgetIdentifier'));
+        $widgetContext->expects($this->once())->method('getParentPluginNamespace')->will($this->returnValue('foo'));
+        $widgetContext->expects($this->once())->method('getWidgetIdentifier')->will($this->returnValue('bar'));
+        $widgetRequest = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array('dummy'));
+        $widgetRequest->_set('widgetContext', $widgetContext);
+        $this->assertEquals('foo[bar]', $widgetRequest->getArgumentPrefix());
+    }
+
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php b/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php
index 5ec768db1c7c..9f184f215800 100644
--- a/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php
@@ -1,20 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\View;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Tests\AccessibleObjectInterface;
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
-use TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer;
 use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
 use TYPO3\CMS\Fluid\View\AbstractTemplateView;
 
@@ -38,11 +39,6 @@ class AbstractTemplateViewTest extends UnitTestCase
      */
     protected $viewHelperVariableContainer;
 
-    /**
-     * @var TemplateVariableContainer|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $templateVariableContainer;
-
     /**
      * Sets up this test case
      *
@@ -50,12 +46,10 @@ class AbstractTemplateViewTest extends UnitTestCase
      */
     protected function setUp()
     {
-        $this->templateVariableContainer = $this->getMock(TemplateVariableContainer::class, array('exists', 'remove', 'add'));
         $this->viewHelperVariableContainer = $this->getMock(ViewHelperVariableContainer::class, array('setView'));
-        $this->renderingContext = $this->getMock(RenderingContext::class, array('getViewHelperVariableContainer', 'getTemplateVariableContainer'));
+        $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class, array('getViewHelperVariableContainer'));
         $this->renderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->viewHelperVariableContainer));
-        $this->renderingContext->expects($this->any())->method('getTemplateVariableContainer')->will($this->returnValue($this->templateVariableContainer));
-        $this->view = $this->getAccessibleMock(AbstractTemplateView::class, array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
+        $this->view = $this->getAccessibleMock(AbstractTemplateView::class, array('dummy'), array(), '', false);
         $this->view->setRenderingContext($this->renderingContext);
     }
 
@@ -67,92 +61,4 @@ class AbstractTemplateViewTest extends UnitTestCase
         $this->viewHelperVariableContainer->expects($this->once())->method('setView')->with($this->view);
         $this->view->setRenderingContext($this->renderingContext);
     }
-
-    /**
-     * @test
-     */
-    public function assignAddsValueToTemplateVariableContainer()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('exists')->with('foo')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValue');
-        $this->templateVariableContainer->expects($this->at(2))->method('exists')->with('bar')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(3))->method('add')->with('bar', 'BarValue');
-
-        $this->view
-            ->assign('foo', 'FooValue')
-            ->assign('bar', 'BarValue');
-    }
-
-    /**
-     * @test
-     */
-    public function assignCanOverridePreviouslyAssignedValues()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('exists')->with('foo')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValue');
-        $this->templateVariableContainer->expects($this->at(2))->method('exists')->with('foo')->will($this->returnValue(true));
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('foo');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('foo', 'FooValueOverridden');
-
-        $this->view->assign('foo', 'FooValue');
-        $this->view->assign('foo', 'FooValueOverridden');
-    }
-
-    /**
-     * @test
-     */
-    public function assignMultipleAddsValuesToTemplateVariableContainer()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('exists')->with('foo')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValue');
-        $this->templateVariableContainer->expects($this->at(2))->method('exists')->with('bar')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(3))->method('add')->with('bar', 'BarValue');
-        $this->templateVariableContainer->expects($this->at(4))->method('exists')->with('baz')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('baz', 'BazValue');
-
-        $this->view
-            ->assignMultiple(array('foo' => 'FooValue', 'bar' => 'BarValue'))
-            ->assignMultiple(array('baz' => 'BazValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function assignMultipleCanOverridePreviouslyAssignedValues()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('exists')->with('foo')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValue');
-        $this->templateVariableContainer->expects($this->at(2))->method('exists')->with('foo')->will($this->returnValue(true));
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('foo');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('foo', 'FooValueOverridden');
-        $this->templateVariableContainer->expects($this->at(5))->method('exists')->with('bar')->will($this->returnValue(false));
-        $this->templateVariableContainer->expects($this->at(6))->method('add')->with('bar', 'BarValue');
-
-        $this->view->assign('foo', 'FooValue');
-        $this->view->assignMultiple(array('foo' => 'FooValueOverridden', 'bar' => 'BarValue'));
-    }
-
-    /**
-     * @return array
-     */
-    public function ucFileNameInPathProperlyUpperCasesFileNamesDataProvider()
-    {
-        return [
-            'keeps ucfirst' => ['LayoutPath', 'LayoutPath'],
-            'creates ucfirst' => ['layoutPath', 'LayoutPath'],
-            'ucfirst on file name only' => ['some/path/layout', 'some/path/Layout'],
-            'keeps ucfirst on file name' => ['some/Path/Layout', 'some/Path/Layout'],
-        ];
-    }
-
-    /**
-     * @param string $path
-     * @param string $expected
-     * @dataProvider ucFileNameInPathProperlyUpperCasesFileNamesDataProvider
-     * @test
-     */
-    public function ucFileNameInPathProperlyUpperCasesFileNames($path, $expected)
-    {
-        $this->assertSame($expected, $this->view->_call('ucFileNameInPath', $path));
-    }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TemplateViewFixture.php b/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TemplateViewFixture.php
index e9fbbc6bb371..fd8c1ea5827f 100644
--- a/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TemplateViewFixture.php
+++ b/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TemplateViewFixture.php
@@ -1,18 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\View\Fixtures;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
- * [Enter description here]
+ * Fixture
  */
 class TemplateViewFixture extends \TYPO3\CMS\Fluid\View\TemplateView
 {
diff --git a/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TransparentSyntaxTreeNode.php b/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TransparentSyntaxTreeNode.php
index cfe04debf832..dc771e2ece42 100644
--- a/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TransparentSyntaxTreeNode.php
+++ b/typo3/sysext/fluid/Tests/Unit/View/Fixtures/TransparentSyntaxTreeNode.php
@@ -1,24 +1,27 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\View\Fixtures;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
- * [Enter description here]
+ * Fixture
  */
-class TransparentSyntaxTreeNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode
+class TransparentSyntaxTreeNode extends \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\AbstractNode
 {
     public $variableContainer;
 
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
+    public function evaluate(\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
     {
     }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php b/typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
index abcb9b12bb74..4c15b22e505a 100644
--- a/typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
@@ -1,36 +1,33 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\View;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
+use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
 use TYPO3\CMS\Extbase\Mvc\Web\Request;
 use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
-use TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler;
-use TYPO3\CMS\Fluid\Core\Parser\TemplateParser;
+use TYPO3\CMS\Fluid\Core\Parser\PreProcessor\XmlnsNamespaceTemplatePreProcessor;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
+use TYPO3\CMS\Fluid\Core\Variables\CmsVariableProvider;
 use TYPO3\CMS\Fluid\View\StandaloneView;
+use TYPO3\CMS\Fluid\View\TemplatePaths;
+use TYPO3Fluid\Core\Compiler\TemplateCompiler;
+use TYPO3Fluid\Fluid\Core\Parser\TemplateParser;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
 
 /**
  * Test case
@@ -62,11 +59,6 @@ class StandaloneViewTest extends UnitTestCase
      */
     protected $mockControllerContext;
 
-    /**
-     * @var TemplateParser|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $mockTemplateParser;
-
     /**
      * @var \TYPO3\CMS\Extbase\Object\ObjectManager|\PHPUnit_Framework_MockObject_MockObject
      */
@@ -82,11 +74,6 @@ class StandaloneViewTest extends UnitTestCase
      */
     protected $mockUriBuilder;
 
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $mockParsedTemplate;
-
     /**
      * @var ConfigurationManagerInterface|\PHPUnit_Framework_MockObject_MockObject
      */
@@ -98,9 +85,19 @@ class StandaloneViewTest extends UnitTestCase
     protected $mockContentObject;
 
     /**
-     * @var TemplateCompiler|\PHPUnit_Framework_MockObject_MockObject
+     * @var TemplatePaths|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $mockTemplatePaths;
+
+    /**
+     * @var CmsVariableProvider|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $mockTemplateCompiler;
+    protected $mockVariableProvider;
+
+    /**
+     * @var CacheManager|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $mockCacheManager;
 
     /**
      * Sets up this test case
@@ -110,10 +107,10 @@ class StandaloneViewTest extends UnitTestCase
     protected function setUp()
     {
         $this->singletonInstances = GeneralUtility::getSingletonInstances();
-        $this->view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array('testFileExistence', 'buildParserConfiguration'), array(), '', false);
-        $this->mockTemplateParser = $this->getMock(TemplateParser::class);
-        $this->mockParsedTemplate = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface::class);
-        $this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
+        $this->view = $this->getAccessibleMock(
+            \TYPO3\CMS\Fluid\View\StandaloneView::class,
+            array('testFileExistence', 'buildParserConfiguration', 'getOrParseAndStoreTemplate'), array(), '', false
+        );
         $this->mockConfigurationManager = $this->getMock(ConfigurationManagerInterface::class);
         $this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
@@ -122,22 +119,24 @@ class StandaloneViewTest extends UnitTestCase
         $this->mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
         $this->mockControllerContext = $this->getMock(ControllerContext::class);
         $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest));
-        $this->mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
-        $this->mockRenderingContext = $this->getMock(RenderingContext::class);
+        $this->mockTemplatePaths = $this->getMock(TemplatePaths::class);
+        $this->mockViewHelperVariableContainer = $this->getMock(ViewHelperVariableContainer::class);
+        $this->mockRenderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
         $this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
-        $this->view->_set('templateParser', $this->mockTemplateParser);
+        $this->mockRenderingContext->expects($this->any())->method('getVariableProvider')->willReturn($this->mockVariableProvider);
+        $this->mockRenderingContext->expects($this->any())->method('getTemplatePaths')->willReturn($this->mockTemplatePaths);
         $this->view->_set('objectManager', $this->mockObjectManager);
-        $this->view->setRenderingContext($this->mockRenderingContext);
-        $this->mockTemplateCompiler = $this->getMock(TemplateCompiler::class);
-        $this->view->_set('templateCompiler', $this->mockTemplateCompiler);
+        $this->view->_set('baseRenderingContext', $this->mockRenderingContext);
+        $this->view->_set('controllerContext', $this->mockControllerContext);
+        $this->view->expects($this->any())->method('getOrParseAndStoreTemplate')->willReturn($this->mockParsedTemplate);
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class, $this->mockObjectManager);
         GeneralUtility::addInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, $this->mockContentObject);
 
-        $mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array(), array(), '', false);
-        $mockCache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, array(), array(), '', false);
-        $mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
-        GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager);
+        $this->mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array(), array(), '', false);
+        $mockCache = $this->getMock(\TYPO3Fluid\Fluid\Core\Cache\FluidCacheInterface::class, array(), array(), '', false);
+        $this->mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
+        GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $this->mockCacheManager);
     }
 
     /**
@@ -171,6 +170,12 @@ class StandaloneViewTest extends UnitTestCase
                 return $this->mockControllerContext;
             case TemplateCompiler::class:
                 return $this->mockTemplateCompiler;
+            case TemplatePaths::class:
+                return $this->mockTemplatePaths;
+            case CacheManager::class:
+                return $this->mockCacheManager;
+            case XmlnsNamespaceTemplatePreProcessor::class:
+                return $this->mockTemplateProcessor;
         }
         throw new \InvalidArgumentException('objectManagerCallback cannot handle class "' . $className . '". Looks like incomplete mocking in the tests.', 1417105493);
     }
@@ -241,48 +246,6 @@ class StandaloneViewTest extends UnitTestCase
         new StandaloneView();
     }
 
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function renderThrowsExceptionIfTemplateIsNotSpecified()
-    {
-        $this->view->render();
-    }
-
-    /**
-     * @test
-     */
-    public function renderPassesSpecifiedTemplateSourceToTemplateParser()
-    {
-        $this->view->setTemplateSource('The Template Source');
-        $this->mockTemplateParser->expects($this->once())->method('parse')->with('The Template Source');
-        $this->view->render();
-    }
-
-    /**
-     * @test
-     */
-    public function renderLoadsSpecifiedTemplateFileAndPassesSourceToTemplateParser()
-    {
-        $templatePathAndFilename = GeneralUtility::fixWindowsFilePath(__DIR__) . '/Fixtures/StandaloneViewFixture.html';
-        $expectedResult = file_get_contents($templatePathAndFilename);
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $this->view->expects($this->once())->method('testFileExistence')->with($templatePathAndFilename)->will($this->returnValue(true));
-        $this->mockTemplateParser->expects($this->once())->method('parse')->with($expectedResult);
-        $this->view->render();
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function renderThrowsExceptionIfSpecifiedTemplateFileDoesNotExist()
-    {
-        $this->view->setTemplatePathAndFilename('NonExistingTemplatePath');
-        @$this->view->render();
-    }
-
     /**
      * @test
      */
@@ -291,713 +254,4 @@ class StandaloneViewTest extends UnitTestCase
         $this->mockRequest->expects($this->once())->method('setFormat')->with('xml');
         $this->view->setFormat('xml');
     }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getLayoutRootPathThrowsExceptionIfLayoutRootPathAndTemplatePathAreNotSpecified()
-    {
-        $this->view->getLayoutRootPath();
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getLayoutRootPathsThrowsExceptionIfLayoutRootPathAndTemplatePathAreNotSpecified()
-    {
-        $this->view->getLayoutRootPaths();
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutRootPathReturnsSpecifiedLayoutRootPathByDefault()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $layoutRootPath = 'some/layout/RootPath';
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $this->view->setLayoutRootPath($layoutRootPath);
-        $actualResult = $this->view->getLayoutRootPath();
-        $this->assertEquals($layoutRootPath, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutRootPathsReturnsSpecifiedLayoutRootPathByDefault()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $layoutRootPaths = array(
-            'some/layout/RootPath'
-        );
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $this->view->setLayoutRootPaths($layoutRootPaths);
-        $actualResult = $this->view->getLayoutRootPaths();
-        $this->assertEquals($layoutRootPaths, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutRootPathReturnsDefaultPathIfNoLayoutRootPathIsSpecified()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $expectedResult = 'some/template/RootPath/Layouts';
-        $actualResult = $this->view->getLayoutRootPath();
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutRootPathsReturnsDefaultPathIfNoLayoutRootPathIsSpecified()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $expectedResult = array('some/template/RootPath/Layouts');
-        $actualResult = $this->view->getLayoutRootPaths();
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getLayoutSourceThrowsExceptionIfLayoutRootPathDoesNotExist()
-    {
-        $this->view->setLayoutRootPath('some/non/existing/Path');
-        $this->view->_call('getLayoutSource');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getLayoutSourceThrowsExceptionIfLayoutRootPathsDoesNotExist()
-    {
-        $this->view->setLayoutRootPaths(array('some/non/existing/Path'));
-        $this->view->_call('getLayoutSource');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getLayoutSourceThrowsExceptionIfLayoutFileDoesNotExist()
-    {
-        $layoutRootPath = __DIR__ . '/Fixtures';
-        $this->view->setLayoutRootPaths(array($layoutRootPath));
-        $this->view->_call('getLayoutSource', 'NonExistingLayout');
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutSourceReturnsContentOfLayoutFileForTheDefaultFormat()
-    {
-        $layoutRootPath = GeneralUtility::fixWindowsFilePath(__DIR__) . '/Fixtures';
-        $this->view->setLayoutRootPath($layoutRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->once())->method('testFileExistence')->with($layoutRootPath . '/LayoutFixture.html')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($layoutRootPath . '/LayoutFixture.html');
-        $actualResult = $this->view->_call('getLayoutSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutSourceReturnsContentOfLayoutFileForTheSpecifiedFormat()
-    {
-        $layoutRootPath = GeneralUtility::fixWindowsFilePath(__DIR__) . '/Fixtures';
-        $this->view->setLayoutRootPath($layoutRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('xml'));
-        $this->view->expects($this->once())->method('testFileExistence')->with($layoutRootPath . '/LayoutFixture.xml')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($layoutRootPath . '/LayoutFixture.xml');
-        $actualResult = $this->view->_call('getLayoutSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat()
-    {
-        $layoutRootPath = GeneralUtility::fixWindowsFilePath(__DIR__) . '/Fixtures';
-        $this->view->setLayoutRootPath($layoutRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('foo'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with($layoutRootPath . '/LayoutFixture.foo')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with($layoutRootPath . '/LayoutFixture')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($layoutRootPath . '/LayoutFixture');
-        $actualResult = $this->view->_call('getLayoutSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getPartialRootPathThrowsExceptionIfPartialRootPathAndTemplatePathAreNotSpecified()
-    {
-        $this->view->getPartialRootPath();
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialRootPathReturnsSpecifiedPartialRootPathByDefault()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $partialRootPath = 'some/partial/RootPath';
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $this->view->setPartialRootPath($partialRootPath);
-        $actualResult = $this->view->getPartialRootPath();
-        $this->assertEquals($partialRootPath, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialRootPathReturnsDefaultPathIfNoPartialRootPathIsSpecified()
-    {
-        $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
-        $this->view->setTemplatePathAndFilename($templatePathAndFilename);
-        $expectedResult = 'some/template/RootPath/Partials';
-        $actualResult = $this->view->getPartialRootPath();
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getPartialSourceThrowsExceptionIfPartialRootPathDoesNotExist()
-    {
-        $this->view->setPartialRootPath('some/non/existing/Path');
-        $this->view->_call('getPartialSource', 'SomePartial');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function getPartialSourceThrowsExceptionIfPartialFileDoesNotExist()
-    {
-        $partialRootPath = __DIR__ . '/Fixtures';
-        $this->view->setPartialRootPath($partialRootPath);
-        $this->view->_call('getPartialSource', 'NonExistingPartial');
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialSourceReturnsContentOfPartialFileForTheDefaultFormat()
-    {
-        $partialRootPath = __DIR__ . '/Fixtures';
-        $this->view->setPartialRootPath($partialRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->once())->method('testFileExistence')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($partialRootPath . '/LayoutFixture.html');
-        $actualResult = $this->view->_call('getPartialSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialSourceReturnsContentOfPartialFileForTheSpecifiedFormat()
-    {
-        $partialRootPath = __DIR__ . '/Fixtures';
-        $this->view->setPartialRootPath($partialRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('xml'));
-        $this->view->expects($this->once())->method('testFileExistence')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($partialRootPath . '/LayoutFixture.xml');
-        $actualResult = $this->view->_call('getPartialSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialSourceReturnsContentOfDefaultPartialFileIfNoPartialExistsForTheSpecifiedFormat()
-    {
-        $partialRootPath = __DIR__ . '/Fixtures';
-        $this->view->setPartialRootPath($partialRootPath);
-        $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('foo'));
-        $this->view->expects($this->at(1))->method('testFileExistence')->will($this->returnValue(true));
-        $expectedResult = file_get_contents($partialRootPath . '/LayoutFixture');
-        $actualResult = $this->view->_call('getPartialSource', 'LayoutFixture');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function setPartialRootPathsOverridesValueSetBySetPartialRootPath()
-    {
-        $this->view->setPartialRootPath('/foo/bar');
-        $this->view->setPartialRootPaths(array('/overruled/path'));
-        $expected = array('/overruled/path');
-        $actual = $this->view->_call('getPartialRootPaths');
-        $this->assertEquals($expected, $actual, 'A set partial root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function setLayoutRootPathsOverridesValuesSetBySetLayoutRootPath()
-    {
-        $this->view->setLayoutRootPath('/foo/bar');
-        $this->view->setLayoutRootPaths(array('/overruled/path'));
-        $expected = array('/overruled/path');
-        $actual = $this->view->_call('getLayoutRootPaths');
-        $this->assertEquals($expected, $actual, 'A set layout root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameRespectsCasingOfLayoutName()
-    {
-        $this->view->setLayoutRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/LayoutName.html')->willReturn(false);
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/LayoutName')->willReturn(false);
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/layoutName.html')->willReturn(true);
-        $this->assertSame(PATH_site . 'some/Default/Directory/layoutName.html', $this->view->_call('getLayoutPathAndFilename', 'layoutName'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameFindsUpperCasedLayoutName()
-    {
-        $this->view->setLayoutRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/LayoutName.html')->willReturn(true);
-        $this->assertSame(PATH_site . 'some/Default/Directory/LayoutName.html', $this->view->_call('getLayoutPathAndFilename', 'layoutName'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameResolvesTheSpecificFile()
-    {
-        $this->view->setLayoutRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Layouts',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->once())->method('testFileExistence')->with(PATH_site . 'specific/Layouts/Default.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'specific/Layouts/Default.html', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameResolvesTheDefaultFile()
-    {
-        $this->view->setLayoutRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Layouts',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Default.html', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameResolvesTheSpecificFileWithNumericIndices()
-    {
-        $this->view->setLayoutRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Layouts',
-            '17' => 'specific/Layouts',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Layouts/Default.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'specific/Layouts/Default.html', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameResolvesTheDefaultFileWithNumericIndices()
-    {
-        $this->view->setLayoutRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Layouts',
-            '17' => 'specific/Layouts',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Default.html', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     * @expectedExceptionCode 1288092555
-     */
-    public function getLayoutPathAndFilenameThrowsExceptionIfNoFileWasFound()
-    {
-        $this->view->setLayoutRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Layouts',
-            '17' => 'specific/Layouts',
-        ));
-        $this->view->expects($this->any())->method('testFileExistence')->will($this->returnValue(false));
-        $this->view->_call('getLayoutPathAndFilename');
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameRespectsCasingOfPartialName()
-    {
-        $this->view->setPartialRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/PartialName.html')->willReturn(false);
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/PartialName')->willReturn(false);
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/partialName.html')->willReturn(true);
-        $this->assertSame(PATH_site . 'some/Default/Directory/partialName.html', $this->view->_call('getPartialPathAndFilename', 'partialName'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameFindsUpperCasedPartialName()
-    {
-        $this->view->setPartialRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/PartialName.html')->willReturn(true);
-        $this->assertSame(PATH_site . 'some/Default/Directory/PartialName.html', $this->view->_call('getPartialPathAndFilename', 'partialName'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameResolvesTheSpecificFile()
-    {
-        $this->view->setPartialRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->once())->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'specific/Partials/Partial.html', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameResolvesTheDefaultFile()
-    {
-        $this->view->setPartialRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Partial.html', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameResolvesTheSpecificFileWithNumericIndices()
-    {
-        $this->view->setPartialRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Partials',
-            '17' => 'specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'specific/Partials/Partial.html', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameResolvesTheDefaultFileWithNumericIndices()
-    {
-        $this->view->setPartialRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Partials',
-            '17' => 'specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial.html')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Partial.html', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     * @expectedExceptionCode 1288092556
-     */
-    public function getPartialPathAndFilenameThrowsExceptionIfNoFileWasFound()
-    {
-        $this->view->setPartialRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Partials',
-            '17' => 'specific/Partials',
-        ));
-        $this->view->expects($this->any())->method('testFileExistence')->will($this->returnValue(false));
-        $this->view->_call('getPartialPathAndFilename', 'Partial');
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameWalksNumericalIndicesInDescendingOrder()
-    {
-        $this->view->setPartialRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Partials',
-            '17' => 'specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Partials/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Partials/Partial')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Partial', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameWalksNumericalIndicesInDescendingOrder()
-    {
-        $this->view->setLayoutRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Layouts',
-            '17' => 'specific/Layouts',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layouts/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layouts/Default')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Layouts/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Layouts/Default')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Default', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialPathAndFilenameWalksStringKeysInReversedOrder()
-    {
-        $this->view->setPartialRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Partials',
-            'verySpecific' => 'evenMore/Specific/Partials',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Partials/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Partials/Partial')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Partials/Partial')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Partial')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Partial', $this->view->_call('getPartialPathAndFilename', 'Partial'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameWalksStringKeysInReversedOrder()
-    {
-        $this->view->setLayoutRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Layout',
-            'verySpecific' => 'evenMore/Specific/Layout',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layout/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layout/Default')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Layout/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Layout/Default')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default')->will($this->returnValue(true));
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Default', $this->view->_call('getLayoutPathAndFilename'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function setTemplateThrowsExceptionIfNoTemplateRootPathsAreSet()
-    {
-        $this->view->setTemplate('TemplateName');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
-     */
-    public function setTemplateThrowsExceptionIfSpecifiedTemplateNameDoesNotExist()
-    {
-        $this->view->setTemplateRootPaths(array(
-            'Some/Template/Path'
-        ));
-        $this->view->setTemplate('NonExistingTemplateName');
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateRespectsCasingOfTemplateName()
-    {
-        $this->view->setTemplateRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/TemplateName.html')->willReturn(false);
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/TemplateName')->willReturn(false);
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/templateName.html')->willReturn(true);
-        $this->view->setTemplate('templateName');
-
-        $this->assertSame(PATH_site . 'some/Default/Directory/templateName.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateSetsUpperCasedTemplateName()
-    {
-        $this->view->setTemplateRootPaths(array('some/Default/Directory'));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/TemplateName.html')->willReturn(true);
-        $this->view->setTemplate('templateName');
-        $this->assertSame(PATH_site . 'some/Default/Directory/TemplateName.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateResolvesTheSpecificTemplateFile()
-    {
-        $this->view->setTemplateRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template.html')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-        $this->assertEquals(PATH_site . 'specific/Templates/Template.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateResolvesTheDefaultTemplateFile()
-    {
-        $this->view->setTemplateRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template.html')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Template.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateResolvesTemplateNameWithPath()
-    {
-        $this->view->setTemplateRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Email/Template.html')->will($this->returnValue(true));
-        $this->view->setTemplate('Email/Template');
-        $this->assertEquals(PATH_site . 'specific/Templates/Email/Template.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateResolvesTheSpecificFileWithNumericIndices()
-    {
-        $this->view->setTemplateRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Templates',
-            '17' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template.html')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-        $this->assertEquals(PATH_site . 'specific/Templates/Template.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateResolvesTheDefaultFileWithNumericIndices()
-    {
-        $this->view->setTemplateRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Templates',
-            '17' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template.html')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Template.html', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateWalksNumericalIndicesInDescendingOrder()
-    {
-        $this->view->setTemplateRootPaths(array(
-            '10' => 'some/Default/Directory',
-            '25' => 'evenMore/Specific/Templates',
-            '17' => 'specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Templates/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Templates/Template')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Template', $this->view->getTemplatePathAndFilename());
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateWalksStringKeysInReversedOrder()
-    {
-        $this->view->setTemplateRootPaths(array(
-            'default' => 'some/Default/Directory',
-            'specific' => 'specific/Templates',
-            'verySpecific' => 'evenMore/Specific/Templates',
-        ));
-        $this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Templates/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Templates/Template')->will($this->returnValue(false));
-        $this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Templates/Template')->will($this->returnValue(false));
-        $this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template.html')->will($this->returnValue(false));
-        $this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Template')->will($this->returnValue(true));
-        $this->view->setTemplate('Template');
-        $this->assertEquals(PATH_site . 'some/Default/Directory/Template', $this->view->getTemplatePathAndFilename());
-    }
 }
diff --git a/typo3/sysext/fluid/Tests/Unit/View/TemplateViewTest.php b/typo3/sysext/fluid/Tests/Unit/View/TemplateViewTest.php
deleted file mode 100644
index 90b417aaad4b..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/View/TemplateViewTest.php
+++ /dev/null
@@ -1,799 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\View;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- * of the License, or (at your option) any later version.                 *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-include_once(__DIR__ . '/Fixtures/TransparentSyntaxTreeNode.php');
-include_once(__DIR__ . '/Fixtures/TemplateViewFixture.php');
-
-use org\bovigo\vfs\vfsStreamWrapper;
-use TYPO3\CMS\Core\Cache\CacheManager;
-use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
-use TYPO3\CMS\Core\Tests\AccessibleObjectInterface;
-use TYPO3\CMS\Core\Tests\UnitTestCase;
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
-use TYPO3\CMS\Extbase\Mvc\Web\Request as WebRequest;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler;
-use TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface;
-use TYPO3\CMS\Fluid\Core\Parser\TemplateParser;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
-use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
-use TYPO3\CMS\Fluid\View\TemplateView;
-use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
-
-/**
- * Test case
- */
-class TemplateViewTest extends UnitTestCase
-{
-    /**
-     * Test for #42123
-     * "Widgets with underscores in class names do not work because the subpackage key is not handled correctly."
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithOldNamingSchemeOfSubPackage()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers_Widget', 'Paginate', 'html');
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', false, false);
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * Test for #42123
-     * "Widgets with underscores in class names do not work because the subpackage key is not handled correctly."
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithNewNamingSchemeOfSubPackage()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers\\Widget', 'Paginate', 'html');
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', false, false);
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * Helper to build mock controller context needed to test expandGenericPathPattern.
-     *
-     * @param string $packageKey
-     * @param string $subPackageKey
-     * @param string $controllerName
-     * @param string $format
-     * @return ControllerContext
-     */
-    protected function setupMockControllerContextForPathResolving($packageKey, $subPackageKey, $controllerName, $format)
-    {
-        $controllerObjectName = "TYPO3\\$packageKey\\" . ($subPackageKey != $subPackageKey . '\\' ? : '') . 'Controller\\' . $controllerName . 'Controller';
-        $mockRequest = $this->getMock(WebRequest::class);
-        $mockRequest->expects($this->any())->method('getControllerExtensionKey')->will($this->returnValue('frontend'));
-        $mockRequest->expects($this->any())->method('getControllerPackageKey')->will($this->returnValue($packageKey));
-        $mockRequest->expects($this->any())->method('getControllerSubPackageKey')->will($this->returnValue($subPackageKey));
-        $mockRequest->expects($this->any())->method('getControllerName')->will($this->returnValue($controllerName));
-        $mockRequest->expects($this->any())->method('getControllerObjectName')->will($this->returnValue($controllerObjectName));
-        $mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue($format));
-
-        $mockControllerContext = $this->getMock(ControllerContext::class, array('getRequest'), array(), '', false);
-        $mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($mockRequest));
-
-        return $mockControllerContext;
-    }
-
-    /**
-     * @return array
-     */
-    public function expandGenericPathPatternDataProvider()
-    {
-        return array(
-            // bubbling controller & subpackage parts and optional format
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action',
-                    'Resources/Private/Templates/Some/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/@action',
-                    'Resources/Private/Templates/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Sub/Package/@action',
-                    'Resources/Private/Templates/Package/@action.html',
-                    'Resources/Private/Templates/Package/@action',
-                    'Resources/Private/Templates/@action.html',
-                    'Resources/Private/Templates/@action',
-                )
-            ),
-            // just optional format
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates/',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => true,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action',
-                )
-            ),
-            // just bubbling controller & subpackage parts
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'json',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => false,
-                'pattern' => '@partialRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Partials/Some/Sub/Package/SomeController/@action.json',
-                    'Resources/Private/Partials/Some/Sub/Package/@action.json',
-                    'Resources/Private/Partials/Sub/Package/@action.json',
-                    'Resources/Private/Partials/Package/@action.json',
-                    'Resources/Private/Partials/@action.json',
-                )
-            ),
-            // layoutRootPath
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => null,
-                'controller' => null,
-                'format' => 'xml',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => '@layoutRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Layouts/@action.xml',
-                    'Resources/Private/Layouts/@action',
-                )
-            ),
-            // partialRootPath
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => null,
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Templates/Some/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/@action',
-                    'Resources/Private/Templates/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Sub/Package/@action',
-                    'Resources/Private/Templates/Package/@action.html',
-                    'Resources/Private/Templates/Package/@action',
-                    'Resources/Private/Templates/@action.html',
-                    'Resources/Private/Templates/@action',
-                )
-            ),
-            // optional format as directory name
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'xml',
-                'templateRootPath' => 'Resources/Private/Templates_@format',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => true,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action',
-                'expectedResult' => array(
-                    'Resources/Private/Templates_xml/Some/Sub/Package/SomeController/@action',
-                    'Resources/Private/Templates_/Some/Sub/Package/SomeController/@action',
-                )
-            ),
-            // mandatory format as directory name
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'json',
-                'templateRootPath' => 'Resources/Private/Templates_@format',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => false,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action',
-                'expectedResult' => array(
-                    'Resources/Private/Templates_json/Some/Sub/Package/SomeController/@action',
-                )
-            ),
-            // paths must not contain double slashes
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => null,
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Some/Root/Path/',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => '@layoutRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Some/Root/Path/SomeController/@action.html',
-                    'Some/Root/Path/SomeController/@action',
-                    'Some/Root/Path/@action.html',
-                    'Some/Root/Path/@action',
-                )
-            ),
-            // paths must be unique
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'json',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => false,
-                'pattern' => 'foo',
-                'expectedResult' => array(
-                    'foo',
-                )
-            ),
-            // template fallback paths
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => array('Resources/Private/Templates', 'Some/Fallback/Path'),
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => true,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action',
-                    'Some/Fallback/Path/Some/Sub/Package/SomeController/@action.html',
-                    'Some/Fallback/Path/Some/Sub/Package/SomeController/@action',
-                )
-            ),
-            // template fallback paths with bubbleControllerAndSubpackage
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => array('Resources/Private/Templates', 'Some/Fallback/Path'),
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => false,
-                'pattern' => '@templateRoot/@subpackage/@controller/@action.@format',
-                'expectedResult' => array(
-                    'Resources/Private/Templates/Some/Sub/Package/SomeController/@action.html',
-                    'Resources/Private/Templates/Some/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Sub/Package/@action.html',
-                    'Resources/Private/Templates/Package/@action.html',
-                    'Resources/Private/Templates/@action.html',
-                    'Some/Fallback/Path/Some/Sub/Package/SomeController/@action.html',
-                    'Some/Fallback/Path/Some/Sub/Package/@action.html',
-                    'Some/Fallback/Path/Sub/Package/@action.html',
-                    'Some/Fallback/Path/Package/@action.html',
-                    'Some/Fallback/Path/@action.html',
-                )
-            ),
-            // partial fallback paths
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => array('Default/Resources/Path', 'Fallback/'),
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => true,
-                'pattern' => '@partialRoot/@subpackage/@controller/@partial.@format',
-                'expectedResult' => array(
-                    'Default/Resources/Path/Some/Sub/Package/SomeController/@partial.html',
-                    'Default/Resources/Path/Some/Sub/Package/SomeController/@partial',
-                    'Fallback/Some/Sub/Package/SomeController/@partial.html',
-                    'Fallback/Some/Sub/Package/SomeController/@partial',
-                )
-            ),
-            // partial fallback paths with bubbleControllerAndSubpackage
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => array('Resources/Private/Templates', 'Some/Fallback/Path'),
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => array('Default/Resources/Path', 'Fallback1/', 'Fallback2'),
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => null,
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => '@partialRoot/@controller/@subpackage/@partial',
-                'expectedResult' => array(
-                    'Default/Resources/Path/SomeController/Some/Sub/Package/@partial',
-                    'Default/Resources/Path/Some/Sub/Package/@partial',
-                    'Default/Resources/Path/Sub/Package/@partial',
-                    'Default/Resources/Path/Package/@partial',
-                    'Default/Resources/Path/@partial',
-                    'Fallback1/SomeController/Some/Sub/Package/@partial',
-                    'Fallback1/Some/Sub/Package/@partial',
-                    'Fallback1/Sub/Package/@partial',
-                    'Fallback1/Package/@partial',
-                    'Fallback1/@partial',
-                    'Fallback2/SomeController/Some/Sub/Package/@partial',
-                    'Fallback2/Some/Sub/Package/@partial',
-                    'Fallback2/Sub/Package/@partial',
-                    'Fallback2/Package/@partial',
-                    'Fallback2/@partial',
-                )
-            ),
-            // layout fallback paths
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => array('Resources/Private/Templates', 'Some/Fallback/Path'),
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => array('foo', 'bar'),
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => array('Default/Layout/Path', 'Fallback/Path'),
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => false,
-                'pattern' => '@layoutRoot/@subpackage/@controller/@layout.@format',
-                'expectedResult' => array(
-                    'Default/Layout/Path/Some/Sub/Package/SomeController/@layout.html',
-                    'Fallback/Path/Some/Sub/Package/SomeController/@layout.html',
-                )
-            ),
-            // layout fallback paths with bubbleControllerAndSubpackage
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => null,
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => null,
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => array('Resources/Layouts', 'Some/Fallback/Path'),
-                'bubbleControllerAndSubpackage' => true,
-                'formatIsOptional' => true,
-                'pattern' => 'Static/@layoutRoot/@subpackage/@controller/@layout.@format',
-                'expectedResult' => array(
-                    'Static/Resources/Layouts/Some/Sub/Package/SomeController/@layout.html',
-                    'Static/Resources/Layouts/Some/Sub/Package/SomeController/@layout',
-                    'Static/Resources/Layouts/Some/Sub/Package/@layout.html',
-                    'Static/Resources/Layouts/Some/Sub/Package/@layout',
-                    'Static/Resources/Layouts/Sub/Package/@layout.html',
-                    'Static/Resources/Layouts/Sub/Package/@layout',
-                    'Static/Resources/Layouts/Package/@layout.html',
-                    'Static/Resources/Layouts/Package/@layout',
-                    'Static/Resources/Layouts/@layout.html',
-                    'Static/Resources/Layouts/@layout',
-                    'Static/Some/Fallback/Path/Some/Sub/Package/SomeController/@layout.html',
-                    'Static/Some/Fallback/Path/Some/Sub/Package/SomeController/@layout',
-                    'Static/Some/Fallback/Path/Some/Sub/Package/@layout.html',
-                    'Static/Some/Fallback/Path/Some/Sub/Package/@layout',
-                    'Static/Some/Fallback/Path/Sub/Package/@layout.html',
-                    'Static/Some/Fallback/Path/Sub/Package/@layout',
-                    'Static/Some/Fallback/Path/Package/@layout.html',
-                    'Static/Some/Fallback/Path/Package/@layout',
-                    'Static/Some/Fallback/Path/@layout.html',
-                    'Static/Some/Fallback/Path/@layout',
-                )
-            ),
-            // combined fallback paths
-            array(
-                'package' => 'Some.Package',
-                'subPackage' => 'Some\\Sub\\Package',
-                'controller' => 'SomeController',
-                'format' => 'html',
-                'templateRootPath' => 'Resources/Private/Templates',
-                'templateRootPaths' => array('Resources/Templates', 'Templates/Fallback1', 'Templates/Fallback2'),
-                'partialRootPath' => 'Resources/Private/Partials',
-                'partialRootPaths' => array('Resources/Partials'),
-                'layoutRootPath' => 'Resources/Private/Layouts',
-                'layoutRootPaths' => array('Resources/Layouts', 'Layouts/Fallback1'),
-                'bubbleControllerAndSubpackage' => false,
-                'formatIsOptional' => true,
-                'pattern' => '@layoutRoot/@templateRoot/@partialRoot/@subpackage/@controller/foo',
-                'expectedResult' => array(
-                    'Resources/Layouts/Resources/Templates/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                    'Layouts/Fallback1/Resources/Templates/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                    'Resources/Layouts/Templates/Fallback1/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                    'Layouts/Fallback1/Templates/Fallback1/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                    'Resources/Layouts/Templates/Fallback2/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                    'Layouts/Fallback1/Templates/Fallback2/Resources/Partials/Some/Sub/Package/SomeController/foo',
-                )
-            ),
-        );
-    }
-
-    /**
-     * @test
-     * @dataProvider expandGenericPathPatternDataProvider()
-     *
-     * @param string $package
-     * @param string $subPackage
-     * @param string $controller
-     * @param string $format
-     * @param string $templateRootPath
-     * @param array $templateRootPaths
-     * @param string $partialRootPath
-     * @param array $partialRootPaths
-     * @param string $layoutRootPath
-     * @param array $layoutRootPaths
-     * @param bool $bubbleControllerAndSubpackage
-     * @param bool $formatIsOptional
-     * @param string $pattern
-     * @param string $expectedResult
-     */
-    public function expandGenericPathPatternTests($package, $subPackage, $controller, $format, $templateRootPath, array $templateRootPaths = null, $partialRootPath, array $partialRootPaths = null, $layoutRootPath, array $layoutRootPaths = null, $bubbleControllerAndSubpackage, $formatIsOptional, $pattern, $expectedResult)
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving($package, $subPackage, $controller, $format);
-
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->setControllerContext($mockControllerContext);
-        if ($templateRootPath !== null) {
-            $templateView->setTemplateRootPath($templateRootPath);
-        }
-        if ($templateRootPaths !== null) {
-            $templateView->setTemplateRootPaths($templateRootPaths);
-        }
-
-        if ($partialRootPath !== null) {
-            $templateView->setPartialRootPath($partialRootPath);
-        }
-        if ($partialRootPaths !== null) {
-            $templateView->setPartialRootPaths($partialRootPaths);
-        }
-
-        if ($layoutRootPath !== null) {
-            $templateView->setLayoutRootPath($layoutRootPath);
-        }
-        if ($layoutRootPaths !== null) {
-            $templateView->setLayoutRootPaths($layoutRootPaths);
-        }
-
-        $actualResult = $templateView->_call('expandGenericPathPattern', $pattern, $bubbleControllerAndSubpackage, $formatIsOptional);
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithBubblingDisabledAndFormatNotOptional()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', null, 'My', 'html');
-
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('getTemplateRootPaths'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
-
-        $expected = array('Resources/Private/Templates/My/@action.html');
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', false, false);
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatNotOptional()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
-
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('getTemplateRootPaths'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', false, false);
-
-        $expected = array(
-            'Resources/Private/Templates/MySubPackage/My/@action.html'
-        );
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatOptional()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
-
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('getTemplateRootPaths'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', false, true);
-
-        $expected = array(
-            'Resources/Private/Templates/MySubPackage/My/@action.html',
-            'Resources/Private/Templates/MySubPackage/My/@action'
-        );
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function expandGenericPathPatternWorksWithSubpackageAndBubblingEnabledAndFormatOptional()
-    {
-        $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
-
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('getTemplateRootPaths'), array(), '', false);
-        $templateView->_set('controllerContext', $mockControllerContext);
-        $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
-        $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', true, true);
-
-        $expected = array(
-            'Resources/Private/Templates/MySubPackage/My/@action.html',
-            'Resources/Private/Templates/MySubPackage/My/@action',
-            'Resources/Private/Templates/MySubPackage/@action.html',
-            'Resources/Private/Templates/MySubPackage/@action',
-            'Resources/Private/Templates/@action.html',
-            'Resources/Private/Templates/@action'
-        );
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function getTemplateRootPathsReturnsUserSpecifiedTemplatePaths()
-    {
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->setTemplateRootPath('/foo/bar');
-        $expected = array('/foo/bar');
-        $actual = $templateView->_call('getTemplateRootPaths');
-        $this->assertEquals($expected, $actual, 'A set template root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function setTemplateRootPathOverrulesSetTemplateRootPaths()
-    {
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->setTemplateRootPath('/foo/bar');
-        $templateView->setTemplateRootPaths(array('/overruled/path'));
-        $expected = array('/overruled/path');
-        $actual = $templateView->_call('getTemplateRootPaths');
-        $this->assertEquals($expected, $actual, 'A set template root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function getPartialRootPathsReturnsUserSpecifiedPartialPath()
-    {
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->setPartialRootPath('/foo/bar');
-        $expected = array('/foo/bar');
-        $actual = $templateView->_call('getPartialRootPaths');
-        $this->assertEquals($expected, $actual, 'A set partial root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutRootPathsReturnsUserSpecifiedPartialPath()
-    {
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('dummy'), array(), '', false);
-        $templateView->setLayoutRootPath('/foo/bar');
-        $expected = array('/foo/bar');
-        $actual = $templateView->_call('getLayoutRootPaths');
-        $this->assertEquals($expected, $actual, 'A set partial root path was not returned correctly.');
-    }
-
-    /**
-     * @test
-     */
-    public function pathToPartialIsResolvedCorrectly()
-    {
-        vfsStreamWrapper::register();
-        mkdir('vfs://MyPartials');
-        \file_put_contents('vfs://MyPartials/SomePartial', 'contentsOfSomePartial');
-
-        $paths = array(
-            'vfs://NonExistentDir/UnknowFile.html',
-            'vfs://MyPartials/SomePartial.html',
-            'vfs://MyPartials/SomePartial'
-        );
-
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', false);
-        $templateView->expects($this->once())->method('expandGenericPathPattern')->with('@partialRoot/@subpackage/@partial.@format', true, true)->will($this->returnValue($paths));
-        $templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
-            $paths[0],
-            $paths[1],
-            $paths[2]
-        ));
-
-        $templateView->setTemplateRootPath('MyTemplates');
-        $templateView->setPartialRootPath('MyPartials');
-        $templateView->setLayoutRootPath('MyLayouts');
-
-        $this->assertSame('contentsOfSomePartial', $templateView->_call('getPartialSource', 'SomePartial'));
-    }
-
-    /**
-     * @test
-     */
-    public function resolveTemplatePathAndFilenameChecksDifferentPathPatternsAndReturnsTheFirstPathWhichExists()
-    {
-        vfsStreamWrapper::register();
-        mkdir('vfs://MyTemplates');
-        \file_put_contents('vfs://MyTemplates/MyCoolAction.html', 'contentsOfMyCoolAction');
-
-        $paths = array(
-            'vfs://NonExistentDir/UnknownFile.html',
-            'vfs://MyTemplates/@action.html'
-        );
-
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', false);
-        $templateView->expects($this->once())->method('expandGenericPathPattern')->with('@templateRoot/@subpackage/@controller/@action.@format', false, false)->will($this->returnValue($paths));
-        $templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
-            $paths[0],
-            'vfs://MyTemplates/MyCoolAction.html'
-        ));
-
-        $templateView->setTemplateRootPath('MyTemplates');
-        $templateView->setPartialRootPath('MyPartials');
-        $templateView->setLayoutRootPath('MyLayouts');
-
-        $this->assertSame('contentsOfMyCoolAction', $templateView->_call('getTemplateSource', 'myCoolAction'));
-    }
-
-    /**
-     * @test
-     */
-    public function resolveTemplatePathAndFilenameReturnsTheExplicitlyConfiguredTemplatePathAndFilename()
-    {
-        vfsStreamWrapper::register();
-        mkdir('vfs://MyTemplates');
-        \file_put_contents('vfs://MyTemplates/MyCoolAction.html', 'contentsOfMyCoolAction');
-
-        $templateView = $this->getAccessibleMock(TemplateView::class, array('resolveFileNamePath'), array(), '', false);
-        $templateView->expects($this->any())->method('resolveFileNamePath')->willReturnArgument(0);
-        $templateView->_set('templatePathAndFilename', 'vfs://MyTemplates/MyCoolAction.html');
-
-        $this->assertSame('contentsOfMyCoolAction', $templateView->_call('getTemplateSource'));
-    }
-
-    /**
-     * @test
-     */
-    public function getLayoutPathAndFilenameRespectsCasingOfLayoutName()
-    {
-        $singletonInstances = GeneralUtility::getSingletonInstances();
-
-        $mockParsedTemplate = $this->getMock(ParsedTemplateInterface::class);
-        $mockTemplateParser = $this->getMock(TemplateParser::class);
-        $mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($mockParsedTemplate));
-
-        /** @var ObjectManager|\PHPUnit_Framework_MockObject_MockObject $mockObjectManager */
-        $mockObjectManager = $this->getMock(ObjectManager::class);
-        $mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
-
-        $mockRequest = $this->getMock(WebRequest::class);
-        $mockControllerContext = $this->getMock(ControllerContext::class);
-        $mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($mockRequest));
-
-        $mockViewHelperVariableContainer = $this->getMock(ViewHelperVariableContainer::class);
-        /** @var RenderingContext|\PHPUnit_Framework_MockObject_MockObject $mockRenderingContext */
-        $mockRenderingContext = $this->getMock(RenderingContext::class);
-        $mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($mockControllerContext));
-        $mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($mockViewHelperVariableContainer));
-
-        /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface $view */
-        $view = $this->getAccessibleMock(TemplateView::class, array('testFileExistence', 'buildParserConfiguration'), array(), '', false);
-        $view->_set('templateParser', $mockTemplateParser);
-        $view->_set('objectManager', $mockObjectManager);
-        $view->setRenderingContext($mockRenderingContext);
-
-        $mockTemplateCompiler = $this->getMock(TemplateCompiler::class);
-        $view->_set('templateCompiler', $mockTemplateCompiler);
-        GeneralUtility::setSingletonInstance(ObjectManager::class, $mockObjectManager);
-        $mockContentObject = $this->getMock(ContentObjectRenderer::class);
-        GeneralUtility::addInstance(ContentObjectRenderer::class, $mockContentObject);
-
-        /** @var CacheManager|\PHPUnit_Framework_MockObject_MockObject $mockCacheManager */
-        $mockCacheManager = $this->getMock(CacheManager::class, array(), array(), '', false);
-        $mockCache = $this->getMock(PhpFrontend::class, array(), array(), '', false);
-        $mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
-        GeneralUtility::setSingletonInstance(CacheManager::class, $mockCacheManager);
-
-        $mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
-        $view->setLayoutRootPaths(array('some/Default/Directory'));
-        $view->setTemplateRootPaths(array('some/Default/Directory'));
-        $view->setPartialRootPaths(array('some/Default/Directory'));
-        $view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/LayoutName.html')->willReturn(false);
-        $view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/layoutName.html')->willReturn(true);
-        $this->assertSame(PATH_site . 'some/Default/Directory/layoutName.html', $view->_call('getLayoutPathAndFilename', 'layoutName'));
-
-        GeneralUtility::purgeInstances();
-        GeneralUtility::resetSingletonInstances($singletonInstances);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/AliasViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/AliasViewHelperTest.php
deleted file mode 100644
index cf13fe2c000f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/AliasViewHelperTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\ViewHelpers\AliasViewHelper;
-
-/**
- * Test case
- */
-class AliasViewHelperTest extends ViewHelperBaseTestcase
-{
-    /**
-     * @var AliasViewHelper
-     */
-    protected $subject;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->subject = $this->getMock(AliasViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->subject);
-    }
-
-    /**
-     * @test
-     */
-    public function renderAddsSingleValueToTemplateVariableContainerAndRemovesItAfterRendering()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('someAlias', 'someValue');
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('someAlias');
-        $this->subject->render(array('someAlias' => 'someValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderAddsMultipleValuesToTemplateVariableContainerAndRemovesThemAfterRendering()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('someAlias', 'someValue');
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('someOtherAlias', 'someOtherValue');
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('someAlias');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('someOtherAlias');
-        $this->subject->render(array('someAlias' => 'someValue', 'someOtherAlias' => 'someOtherValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderDoesNotTouchTemplateVariableContainerAndReturnsChildNodesIfMapIsEmpty()
-    {
-        $this->subject->expects($this->once())->method('renderChildren')->will($this->returnValue('foo'));
-        $this->templateVariableContainer->expects($this->never())->method('add');
-        $this->templateVariableContainer->expects($this->never())->method('remove');
-        $this->assertEquals('foo', $this->subject->render(array()));
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php
index d2e91f0d2682..933efe8ab1e7 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfAuthenticatedViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfAuthenticatedViewHelperTest.php
similarity index 51%
rename from typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfAuthenticatedViewHelperTest.php
rename to typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfAuthenticatedViewHelperTest.php
index 2e2291c67a74..b746812149e2 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfAuthenticatedViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfAuthenticatedViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Be;
+namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Be\Security;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Testcase for be.security.ifAuthenticated view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfHasRoleViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfHasRoleViewHelperTest.php
similarity index 65%
rename from typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfHasRoleViewHelperTest.php
rename to typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfHasRoleViewHelperTest.php
index 1367c48ef058..4623b135fc01 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfHasRoleViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/Security/IfHasRoleViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Be;
+namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Be\Security;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Testcase for be.security.ifHasRole view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php
deleted file mode 100644
index e45a2be33894..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for CaseViewHelper
- */
-class CaseViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper::class, array('buildRenderChildrenClosure'));
-        $this->viewHelper->expects($this->any())->method('buildRenderChildrenClosure')->will($this->returnValue(function () {
-            return 'ChildNodes';
-        }));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionIfSwitchExpressionIsNotSetInViewHelperVariableContainer()
-    {
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(false));
-        $this->viewHelper->render('foo');
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsChildNodesIfTheSpecifiedValueIsEqualToTheSwitchExpression()
-    {
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(true));
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(array(array(
-            'break' => false,
-            'expression' => 'someValue'
-        ))));
-
-        $renderedChildNodes = 'ChildNodes';
-
-        $this->assertSame($renderedChildNodes, $this->viewHelper->render('someValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderSetsBreakStateInViewHelperVariableContainerIfTheSpecifiedValueIsEqualToTheSwitchExpression()
-    {
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(true));
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(array(array(
-            'break' => false,
-            'expression' => 'someValue'
-        ))));
-
-        $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack', array(array(
-            'break' => true,
-            'expression' => 'someValue'
-        )));
-
-        $this->viewHelper->render('someValue');
-    }
-
-    /**
-     * @test
-     */
-    public function renderWeaklyComparesSpecifiedValueWithSwitchExpression()
-    {
-        $numericValue = 123;
-        $stringValue = '123';
-
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(true));
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(array(array(
-            'break' => false,
-            'expression' => $numericValue
-        ))));
-
-        $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack', array(array(
-            'break' => true,
-            'expression' => $numericValue
-        )));
-
-        $this->viewHelper->render($stringValue);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsAnEmptyStringIfTheSpecifiedValueIsNotEqualToTheSwitchExpression()
-    {
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(true));
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(array(array(
-            'break' => false,
-            'expression' => 'someValue'
-        ))));
-
-        $this->assertSame('', $this->viewHelper->render('someOtherValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsChildNodesIfDefaultIsTrue()
-    {
-        $this->viewHelperVariableContainer->expects(
-            $this->atLeastOnce())
-            ->method('exists')
-            ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')
-            ->will($this->returnValue(true)
-            );
-        $this->viewHelperVariableContainer->expects(
-            $this->atLeastOnce())->method('get')
-            ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')
-            ->will($this->returnValue(array(array(
-                'break' => false,
-                'expression' => 'someExpression'
-            )))
-            );
-
-        $renderedChildNodes = 'ChildNodes';
-        $this->viewHelper->expects($this->once())->method('buildRenderChildrenClosure')->will($this->returnValue(function () {
-            return 'ChildNodes';
-        }));
-
-        $this->assertSame($renderedChildNodes, $this->viewHelper->render(null, true));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionIfNeighterValueNorDefaultAreGiven()
-    {
-        $this->viewHelperVariableContainer->expects(
-            $this->atLeastOnce())
-            ->method('exists')
-            ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')
-            ->will($this->returnValue(true)
-            );
-        $this->viewHelperVariableContainer->expects($this->never())->method('get');
-
-        $this->viewHelper->render(null, false);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsChildNodesEvenIfValueIsFalseButDefaultIsTrue()
-    {
-        $this->viewHelperVariableContainer->expects(
-            $this->atLeastOnce())
-            ->method('exists')
-            ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')
-            ->will($this->returnValue(true)
-            );
-        $this->viewHelperVariableContainer->expects(
-            $this->atLeastOnce())->method('get')
-            ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')
-            ->will($this->returnValue(array(array(
-                'break' => false,
-                'expression' => 'someValue'
-            )))
-            );
-
-        $renderedChildNodes = 'ChildNodes';
-
-        $this->assertSame($renderedChildNodes, $this->viewHelper->render('someOtherValue', true));
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CountViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CountViewHelperTest.php
deleted file mode 100644
index 353fec915950..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CountViewHelperTest.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for CountViewHelper
- */
-class CountViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsNumberOfElementsInAnArray()
-    {
-        $expectedResult = 3;
-        $actualResult = $this->viewHelper->render(array('foo', 'bar', 'Baz'));
-        $this->assertSame($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsNumberOfElementsInAnArrayObject()
-    {
-        $expectedResult = 2;
-        $actualResult = $this->viewHelper->render(new \ArrayObject(array('foo', 'bar')));
-        $this->assertSame($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsZeroIfGivenArrayIsEmpty()
-    {
-        $expectedResult = 0;
-        $actualResult = $this->viewHelper->render(array());
-        $this->assertSame($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderUsesChildrenAsSubjectIfGivenSubjectIsNull()
-    {
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(array('foo', 'bar', 'baz')));
-        $expectedResult = 3;
-        $actualResult = $this->viewHelper->render(null);
-        $this->assertSame($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsZeroIfGivenSubjectIsNullAndRenderChildrenReturnsNull()
-    {
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(null));
-        $expectedResult = 0;
-        $actualResult = $this->viewHelper->render(null);
-        $this->assertSame($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionIfGivenSubjectIsNotCountable()
-    {
-        $object = new \stdClass();
-        $this->viewHelper->render($object);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CycleViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CycleViewHelperTest.php
deleted file mode 100644
index 2a0d834281a2..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/CycleViewHelperTest.php
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for CycleViewHelper
- */
-class CycleViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\CycleViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\CycleViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function renderAddsCurrentValueToTemplateVariableContainerAndRemovesItAfterRendering()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('innerVariable', 'bar');
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('innerVariable');
-
-        $values = array('bar', 'Fluid');
-        $this->viewHelper->render($values, 'innerVariable');
-    }
-
-    /**
-     * @test
-     */
-    public function renderAddsFirstValueToTemplateVariableContainerAfterLastValue()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('innerVariable', 'bar');
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(2))->method('add')->with('innerVariable', 'Fluid');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('innerVariable', 'bar');
-        $this->templateVariableContainer->expects($this->at(5))->method('remove')->with('innerVariable');
-
-        $values = array('bar', 'Fluid');
-        $this->viewHelper->render($values, 'innerVariable');
-        $this->viewHelper->render($values, 'innerVariable');
-        $this->viewHelper->render($values, 'innerVariable');
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperSupportsAssociativeArrays()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('innerVariable', 'FLOW3');
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(2))->method('add')->with('innerVariable', 'Fluid');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('innerVariable', 'FLOW3');
-        $this->templateVariableContainer->expects($this->at(5))->method('remove')->with('innerVariable');
-
-        $values = array('foo' => 'FLOW3', 'bar' => 'Fluid');
-        $this->viewHelper->render($values, 'innerVariable');
-        $this->viewHelper->render($values, 'innerVariable');
-        $this->viewHelper->render($values, 'innerVariable');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionWhenPassingObjectsToValuesThatAreNotTraversable()
-    {
-        $object = new \stdClass();
-
-        $this->viewHelper->render($object, 'innerVariable');
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsChildNodesIfValuesIsNull()
-    {
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Child nodes'));
-
-        $this->assertEquals('Child nodes', $this->viewHelper->render(null, 'foo'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsChildNodesIfValuesIsAnEmptyArray()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('foo', null);
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('foo');
-
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Child nodes'));
-
-        $this->assertEquals('Child nodes', $this->viewHelper->render(array(), 'foo'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderIteratesThroughElementsOfTraversableObjects()
-    {
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('innerVariable', 'value1');
-        $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(2))->method('add')->with('innerVariable', 'value2');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('innerVariable');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('innerVariable', 'value1');
-        $this->templateVariableContainer->expects($this->at(5))->method('remove')->with('innerVariable');
-
-        $traversableObject = new \ArrayObject(array('key1' => 'value1', 'key2' => 'value2'));
-        $this->viewHelper->render($traversableObject, 'innerVariable');
-        $this->viewHelper->render($traversableObject, 'innerVariable');
-        $this->viewHelper->render($traversableObject, 'innerVariable');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ElseViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ElseViewHelperTest.php
deleted file mode 100644
index 91f78ece6fa1..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ElseViewHelperTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper;
-
-/**
- * Test case
- */
-class ElseViewHelperTest extends ViewHelperBaseTestcase
-{
-    /**
-     * @var ElseViewHelper|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $subject;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->subject = $this->getMock(ElseViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->subject);
-    }
-
-    /**
-     * @test
-     */
-    public function renderRendersChildren()
-    {
-        $this->subject->expects($this->once())->method('renderChildren')->will($this->returnValue('foo'));
-        $actualResult = $this->subject->render();
-        $this->assertEquals('foo', $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/ConstraintSyntaxTreeNode.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/ConstraintSyntaxTreeNode.php
deleted file mode 100644
index 1faf2d8582be..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/ConstraintSyntaxTreeNode.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Constraint syntax tree node fixture
- */
-class ConstraintSyntaxTreeNode extends \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
-{
-    public $callProtocol = array();
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
-     */
-    protected $variableContainer;
-
-    public function __construct(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer)
-    {
-        $this->variableContainer = $variableContainer;
-    }
-
-    public function evaluateChildNodes(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-        $identifiers = $this->variableContainer->getAllIdentifiers();
-        $callElement = array();
-        foreach ($identifiers as $identifier) {
-            $callElement[$identifier] = $this->variableContainer->get($identifier);
-        }
-        $this->callProtocol[] = $callElement;
-    }
-
-    public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
-    {
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForEmptyString.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForEmptyString.php
index 3f9980602ff2..7a810001c757 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForEmptyString.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForEmptyString.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper;
 
 /**
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForTranslatedString.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForTranslatedString.php
index 6e692cbd7b64..903862f4bf19 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForTranslatedString.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Fixtures/TranslateViewHelperFixtureForTranslatedString.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper;
 
 /**
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FlashMessagesViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FlashMessagesViewHelperTest.php
index ea6c6393a46a..6ac46f3855bf 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FlashMessagesViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FlashMessagesViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Testcase for FlashMessagesViewHelper
@@ -38,18 +41,18 @@ class FlashMessagesViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelper
      */
     protected function setUp()
     {
+        parent::setUp();
         /** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue|\PHPUnit_Framework_MockObject_MockObject $mockFlashMessagingQueue */
         $mockFlashMessagingQueue = $this->getMock(\TYPO3\CMS\Core\Messaging\FlashMessageQueue::class, array('getAllMessagesAndFlush'), array('foo'));
         $mockFlashMessagingQueue->expects($this->once())->method('getAllMessagesAndFlush')->will($this->returnValue(array()));
         $this->mockFlashMessagingQueue = $mockFlashMessagingQueue;
 
-        $mockControllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
-        $mockControllerContext->expects($this->any())->method('getFlashMessageQueue')->will($this->returnValue($mockFlashMessagingQueue));
+        $this->controllerContext->expects($this->any())->method('getFlashMessageQueue')->will($this->returnValue($mockFlashMessagingQueue));
 
         $this->mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class);
         $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FlashMessagesViewHelper::class, array('dummy'));
-        $this->viewHelper->_set('controllerContext', $mockControllerContext);
         $this->viewHelper->_set('tag', $this->mockTagBuilder);
+        $this->viewHelper->setRenderingContext($this->renderingContext);
         $this->viewHelper->initialize();
     }
 
@@ -68,10 +71,8 @@ class FlashMessagesViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelper
     {
         $queueIdentifier = 'myQueue';
 
-        $mockControllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
-        $mockControllerContext->expects($this->once())->method('getFlashMessageQueue')->with($queueIdentifier)->will($this->returnValue($this->mockFlashMessagingQueue));
+        $this->controllerContext->expects($this->once())->method('getFlashMessageQueue')->with($queueIdentifier)->will($this->returnValue($this->mockFlashMessagingQueue));
 
-        $this->viewHelper->_set('controllerContext', $mockControllerContext);
         $this->viewHelper->setArguments(array('queueIdentifier' => $queueIdentifier));
 
         $this->assertEmpty($this->viewHelper->render());
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ForViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ForViewHelperTest.php
deleted file mode 100644
index 9ab65bc31530..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ForViewHelperTest.php
+++ /dev/null
@@ -1,429 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for ForViewHelper
- */
-class ForViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->templateVariableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer(array());
-        $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
-
-        $this->arguments['reverse'] = null;
-        $this->arguments['key'] = '';
-        $this->arguments['iteration'] = null;
-    }
-
-    /**
-     * @test
-     */
-    public function renderExecutesTheLoopCorrectly()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-        $this->arguments['each'] = array(0, 1, 2, 3);
-        $this->arguments['as'] = 'innerVariable';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as']);
-
-        $expectedCallProtocol = array(
-            array('innerVariable' => 0),
-            array('innerVariable' => 1),
-            array('innerVariable' => 2),
-            array('innerVariable' => 3)
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function renderPreservesKeys()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array('key1' => 'value1', 'key2' => 'value2');
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'value1',
-                'someKey' => 'key1'
-            ),
-            array(
-                'innerVariable' => 'value2',
-                'someKey' => 'key2'
-            )
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsEmptyStringIfObjectIsNull()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $this->arguments['each'] = null;
-        $this->arguments['as'] = 'foo';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-
-        $this->assertEquals('', $viewHelper->render($this->arguments['each'], $this->arguments['as']));
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsEmptyStringIfObjectIsEmptyArray()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $this->arguments['each'] = array();
-        $this->arguments['as'] = 'foo';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-
-        $this->assertEquals('', $viewHelper->render($this->arguments['each'], $this->arguments['as']));
-    }
-
-    /**
-     * @test
-     */
-    public function renderIteratesElementsInReverseOrderIfReverseIsTrue()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array(0, 1, 2, 3);
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['reverse'] = true;
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key'], $this->arguments['reverse']);
-
-        $expectedCallProtocol = array(
-            array('innerVariable' => 3),
-            array('innerVariable' => 2),
-            array('innerVariable' => 1),
-            array('innerVariable' => 0)
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function renderPreservesKeysIfReverseIsTrue()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array('key1' => 'value1', 'key2' => 'value2');
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-        $this->arguments['reverse'] = true;
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key'], $this->arguments['reverse']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'value2',
-                'someKey' => 'key2'
-            ),
-            array(
-                'innerVariable' => 'value1',
-                'someKey' => 'key1'
-            )
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function keyContainsNumericalIndexIfTheGivenArrayDoesNotHaveAKey()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array('foo', 'bar', 'baz');
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'foo',
-                'someKey' => 0
-            ),
-            array(
-                'innerVariable' => 'bar',
-                'someKey' => 1
-            ),
-            array(
-                'innerVariable' => 'baz',
-                'someKey' => 2
-            )
-        );
-        $this->assertSame($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function keyContainsNumericalIndexInAscendingOrderEvenIfReverseIsTrueIfTheGivenArrayDoesNotHaveAKey()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array('foo', 'bar', 'baz');
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-        $this->arguments['reverse'] = true;
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key'], $this->arguments['reverse']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'baz',
-                'someKey' => 0
-            ),
-            array(
-                'innerVariable' => 'bar',
-                'someKey' => 1
-            ),
-            array(
-                'innerVariable' => 'foo',
-                'someKey' => 2
-            )
-        );
-        $this->assertSame($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionWhenPassingObjectsToEachThatAreNotTraversable()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-        $object = new \stdClass();
-
-        $this->arguments['each'] = $object;
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-        $this->arguments['reverse'] = true;
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key']);
-    }
-
-    /**
-     * @test
-     */
-    public function renderIteratesThroughElementsOfTraversableObjects()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = new \ArrayObject(array('key1' => 'value1', 'key2' => 'value2'));
-        $this->arguments['as'] = 'innerVariable';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as']);
-
-        $expectedCallProtocol = array(
-            array('innerVariable' => 'value1'),
-            array('innerVariable' => 'value2')
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function renderPreservesKeyWhenIteratingThroughElementsOfObjectsThatImplementIteratorInterface()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = new \ArrayIterator(array('key1' => 'value1', 'key2' => 'value2'));
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'value1',
-                'someKey' => 'key1'
-            ),
-            array(
-                'innerVariable' => 'value2',
-                'someKey' => 'key2'
-            )
-        );
-        $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function keyContainsTheNumericalIndexWhenIteratingThroughElementsOfObjectsOfTyeSplObjectStorage()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $splObjectStorageObject = new \SplObjectStorage();
-        $object1 = new \stdClass();
-        $splObjectStorageObject->attach($object1);
-        $object2 = new \stdClass();
-        $splObjectStorageObject->attach($object2, 'foo');
-        $object3 = new \stdClass();
-        $splObjectStorageObject->attach($object3, 'bar');
-
-        $this->arguments['each'] = $splObjectStorageObject;
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['key'] = 'someKey';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => $object1,
-                'someKey' => 0
-            ),
-            array(
-                'innerVariable' => $object2,
-                'someKey' => 1
-            ),
-            array(
-                'innerVariable' => $object3,
-                'someKey' => 2
-            )
-        );
-        $this->assertSame($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function iterationDataIsAddedToTemplateVariableContainerIfIterationArgumentIsSet()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $this->arguments['each'] = array('foo' => 'bar', 'FLOW3' => 'Fluid', 'TYPO3' => 'rocks');
-        $this->arguments['as'] = 'innerVariable';
-        $this->arguments['iteration'] = 'iteration';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as'], $this->arguments['key'], $this->arguments['reverse'], $this->arguments['iteration']);
-
-        $expectedCallProtocol = array(
-            array(
-                'innerVariable' => 'bar',
-                'iteration' => array(
-                    'index' => 0,
-                    'cycle' => 1,
-                    'total' => 3,
-                    'isFirst' => true,
-                    'isLast' => false,
-                    'isEven' => false,
-                    'isOdd' => true
-                )
-            ),
-            array(
-                'innerVariable' => 'Fluid',
-                'iteration' => array(
-                    'index' => 1,
-                    'cycle' => 2,
-                    'total' => 3,
-                    'isFirst' => false,
-                    'isLast' => false,
-                    'isEven' => true,
-                    'isOdd' => false
-                )
-            ),
-            array(
-                'innerVariable' => 'rocks',
-                'iteration' => array(
-                    'index' => 2,
-                    'cycle' => 3,
-                    'total' => 3,
-                    'isFirst' => false,
-                    'isLast' => true,
-                    'isEven' => false,
-                    'isOdd' => true
-                )
-            )
-        );
-        $this->assertSame($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs -> The for loop does not work as it should!');
-    }
-
-    /**
-     * @test
-     */
-    public function iteratedItemsAreNotCountedIfIterationArgumentIsNotSet()
-    {
-        $viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\ForViewHelper();
-
-        $viewHelperNode = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\ConstraintSyntaxTreeNode($this->templateVariableContainer);
-
-        $mockItems = $this->getMockBuilder(\ArrayObject::class)->setMethods(['count'])->disableOriginalConstructor()->getMock();
-        $mockItems->expects($this->never())->method('count');
-        $this->arguments['each'] = $mockItems;
-        $this->arguments['as'] = 'innerVariable';
-
-        $this->injectDependenciesIntoViewHelper($viewHelper);
-        $viewHelper->setViewHelperNode($viewHelperNode);
-        $viewHelper->render($this->arguments['each'], $this->arguments['as']);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
index 1315f9bca825..889e65a61354 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
@@ -74,33 +74,6 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
         $this->assertSame($expected, $actual);
     }
 
-    /**
-     * @test
-     */
-    public function ifAnAttributeValueIsAnObjectMaintainedByThePersistenceManagerItIsConvertedToAUID()
-    {
-        $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
-        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will(
-            $this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66')
-        );
-
-        $object = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\EmptyClass::class);
-        $object->expects($this->any())->method('FLOW3_Persistence_isNew')->will($this->returnValue(false));
-
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, ['dummy'], [], '', false
-        );
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-        $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
-
-        $arguments = ['name' => 'foo', 'value' => $object, 'property' => null];
-        $formViewHelper->_set('arguments', $arguments);
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(false));
-
-        $this->assertSame('foo[__identity]', $formViewHelper->_call('getName'));
-        $this->assertSame('6f487e40-4483-11de-8a39-0800200c9a66', $formViewHelper->_call('getValue'));
-    }
-
     /**
      * @test
      */
@@ -214,123 +187,6 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
         $this->assertSame($expected, $actual);
     }
 
-    /**
-     * @test
-     */
-    public function getValueBuildsValueFromPropertyAndFormObjectIfInObjectAccessorMode()
-    {
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class,
-            ['isObjectAccessorMode', 'addAdditionalIdentityPropertiesIfNeeded'], [], '', false
-        );
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-
-        $mockObject = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\ClassWithTwoGetters();
-
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(true));
-        $formViewHelper->expects($this->once())->method('addAdditionalIdentityPropertiesIfNeeded');
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(
-            \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject'
-        )->will($this->returnValue($mockObject));
-        $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(
-            \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject'
-        )->will($this->returnValue(true));
-
-        $arguments = ['name' => null, 'value' => null, 'property' => 'value.something'];
-        $formViewHelper->_set('arguments', $arguments);
-        $expected = 'MyString';
-        $actual = $formViewHelper->_call('getValue');
-        $this->assertSame($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function getValueReturnsNullIfNotInObjectAccessorModeAndValueArgumentIsNoSet()
-    {
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, ['isObjectAccessorMode'], [], '',
-            false
-        );
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(false));
-
-        $mockArguments = [];
-        $formViewHelper->_set('arguments', $mockArguments);
-
-        $this->assertNull($formViewHelper->_call('getValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function getValueReturnsValueArgumentIfSpecified()
-    {
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, ['isObjectAccessorMode'], [], '',
-            false
-        );
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(false));
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-
-        $mockArguments = ['value' => 'someValue'];
-        $formViewHelper->_set('arguments', $mockArguments);
-
-        $this->assertEquals('someValue', $formViewHelper->_call('getValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function getValueConvertsObjectsToIdentifiersByDefault()
-    {
-        $mockObject = $this->getMock('stdClass');
-
-        $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
-        $mockPersistenceManager->expects($this->atLeastOnce())->method('getIdentifierByObject')->with(
-            $mockObject
-        )->will($this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66'));
-
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, ['isObjectAccessorMode'], [], '',
-            false
-        );
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(false));
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-        $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
-
-        $mockArguments = ['value' => $mockObject];
-        $formViewHelper->_set('arguments', $mockArguments);
-
-        $this->assertSame('6f487e40-4483-11de-8a39-0800200c9a66', $formViewHelper->_call('getValue'));
-    }
-
-    /**
-     * @test
-     */
-    public function getValueDoesNotConvertObjectsIfConvertObjectsIsFalse()
-    {
-        $mockObject = $this->getMock('stdClass');
-
-        $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
-        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will(
-            $this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66')
-        );
-
-        $formViewHelper = $this->getAccessibleMock(
-            \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, ['isObjectAccessorMode'], [], '',
-            false
-        );
-        $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(false));
-        $this->injectDependenciesIntoViewHelper($formViewHelper);
-        $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
-
-        $mockArguments = ['value' => $mockObject];
-        $formViewHelper->_set('arguments', $mockArguments);
-
-        $this->assertSame($mockObject, $formViewHelper->_call('getValue', false));
-    }
-
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php
index 1646e9459eef..47b45281043a 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the Abstract Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/ButtonViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/ButtonViewHelperTest.php
index 3d8ddb014bc1..e87131ebd8ca 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/ButtonViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/ButtonViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script belongs to the FLOW3 package "TYPO3.Fluid".                *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Button" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/CheckboxViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/CheckboxViewHelperTest.php
index 25bce69ed22e..61e649493919 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/CheckboxViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/CheckboxViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder;
 use TYPO3\CMS\Fluid\ViewHelpers\Form\CheckboxViewHelper;
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ClassWithTwoGetters.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ClassWithTwoGetters.php
index 741e50fbbca1..6d2d399e6d66 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ClassWithTwoGetters.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ClassWithTwoGetters.php
@@ -1,7 +1,7 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures;
 
-/*
+/**
  * This file is part of the TYPO3 CMS project.
  *
  * It is free software; you can redistribute it and/or modify it under
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptyClass.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptyClass.php
index eb19ce43382f..0326a277b2d7 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptyClass.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptyClass.php
@@ -1,7 +1,7 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures;
 
-/*
+/**
  * This file is part of the TYPO3 CMS project.
  *
  * It is free software; you can redistribute it and/or modify it under
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptySyntaxTreeNode.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptySyntaxTreeNode.php
index 4b2225cc1e7f..8e06c86c21a1 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptySyntaxTreeNode.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/EmptySyntaxTreeNode.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/**
+ * 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!
+ */
 
 /**
  * [Enter description here]
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ExtendsAbstractEntity.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ExtendsAbstractEntity.php
index 8a0f581aea0a..3d704292bb17 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ExtendsAbstractEntity.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/ExtendsAbstractEntity.php
@@ -1,7 +1,7 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures;
 
-/*
+/**
  * This file is part of the TYPO3 CMS project.
  *
  * It is free software; you can redistribute it and/or modify it under
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/UserDomainClass.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/UserDomainClass.php
index 6da575221f87..87b8c67c6ec3 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/UserDomainClass.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Fixtures/UserDomainClass.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/**
+ * 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!
+ */
 
 /**
  * Example domain class which can be used to test different view helpers, e.g. the "select" view helper.
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php
index 85c58228ea61..a4c76f680d75 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php
@@ -1,25 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
 
 /**
  * Test for the Abstract Form view helper
@@ -41,10 +35,10 @@ abstract class FormFieldViewHelperBaseTestcase extends \TYPO3\CMS\Fluid\Tests\Un
     }
 
     /**
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper
+     * @param ViewHelperInterface $viewHelper
      * @return void
      */
-    protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
+    protected function injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper)
     {
         $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
         parent::injectDependenciesIntoViewHelper($viewHelper);
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php
index f817cd4f95db..eccf3fc33ad8 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\ViewHelpers\Form\HiddenViewHelper;
 
 /**
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/PasswordViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/PasswordViewHelperTest.php
index 82841b00751a..8c5a30655a5f 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/PasswordViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/PasswordViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Password" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/RadioViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/RadioViewHelperTest.php
index ea2c678a28c3..3cad1113785f 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/RadioViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/RadioViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\ViewHelpers\Form\RadioViewHelper;
 
 /**
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
index e009ba27f73c..25a5235506c3 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Select" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SubmitViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SubmitViewHelperTest.php
index 46fee6922865..594ef6a904d0 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SubmitViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SubmitViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Submit" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextareaViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextareaViewHelperTest.php
index 05b3f4da28b8..0808ba3c267c 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextareaViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextareaViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Textarea" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php
index 467622662672..d9fe370bac7b 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Textfield" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/UploadViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/UploadViewHelperTest.php
index 9ffd0e789523..d395a90a7da6 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/UploadViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/UploadViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for the "Upload" Form view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php
index 645af7a667fa..c5bfa4cd373a 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php
@@ -1,26 +1,20 @@
 <?php
-
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License as published by the Free   *
- * Software Foundation, either version 3 of the License, or (at your      *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        *
- * You should have received a copy of the GNU General Public License      *
- * along with the script.                                                 *
- * If not, see http://www.gnu.org/licenses/gpl.html                       *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
 
 /**
  * Test for the Form view helper
@@ -45,10 +39,39 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     }
 
     /**
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper
+     * @test
+     */
+    public function initializeArgumentsRegistersExpectedArguments()
+    {
+        $viewHelper = $this->getMock(FormViewHelper::class, array('registerTagAttribute', 'registerUniversalTagAttributes'));
+        $viewHelper->expects($this->at(0))->method('registerTagAttribute')->with('enctype', 'string', $this->anything());
+        $viewHelper->expects($this->at(1))->method('registerTagAttribute')->with('method', 'string', $this->anything());
+        $viewHelper->expects($this->at(2))->method('registerTagAttribute')->with('name', 'string', $this->anything());
+        $viewHelper->expects($this->at(3))->method('registerTagAttribute')->with('onreset', 'string', $this->anything());
+        $viewHelper->expects($this->at(4))->method('registerTagAttribute')->with('onsubmit', 'string', $this->anything());
+        $viewHelper->expects($this->once())->method('registerUniversalTagAttributes');
+        $viewHelper->initializeArguments();
+    }
+
+    /**
+     * @test
+     */
+    public function setFormActionUriRespectsOverriddenArgument()
+    {
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, array('hasArgument'));
+        $viewHelper->expects($this->once())->method('hasArgument')->with('actionUri')->willReturn(true);
+        $tagBuilder = $this->getMock(TagBuilder::class, array('addAttribute'));
+        $tagBuilder->expects($this->once())->method('addAttribute')->with('action', 'foobar');
+        $viewHelper->_set('tag', $tagBuilder);
+        $viewHelper->setArguments(array('actionUri' => 'foobar'));
+        $this->callInaccessibleMethod($viewHelper, 'setFormActionUri');
+    }
+
+    /**
+     * @param ViewHelperInterface $viewHelper
      * @return void
      */
-    protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
+    protected function injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper)
     {
         $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
         parent::injectDependenciesIntoViewHelper($viewHelper);
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/BytesViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/BytesViewHelperTest.php
index f770367c4089..7613ba8b632a 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/BytesViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/BytesViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CaseViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CaseViewHelperTest.php
index dd664c79f4cf..93c1d1f037a1 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CaseViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CaseViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CropViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CropViewHelperTest.php
index 98f9dca45d58..13fd6fd22340 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CropViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CropViewHelperTest.php
@@ -1,28 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License as published by the Free   *
- * Software Foundation, either version 3 of the License, or (at your      *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        *
- * You should have received a copy of the GNU General Public License      *
- * along with the script.                                                 *
- * If not, see http://www.gnu.org/licenses/gpl.html                       *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 
 /**
@@ -46,7 +37,7 @@ class CropViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->mockContentObject = $this->getMock(ContentObjectRenderer::class, array(), array(), '', false);
         $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper::class, array('renderChildren'));
 
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->viewHelper->setRenderingContext($renderingContext);
         $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Some Content'));
     }
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CurrencyViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CurrencyViewHelperTest.php
index 85bc5c088f36..733af2445819 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CurrencyViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CurrencyViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper;
 
@@ -27,7 +30,7 @@ class CurrencyViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         $this->subject = $this->getAccessibleMock(CurrencyViewHelper::class, array('renderChildren'));
         /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->subject->_set('renderingContext', $renderingContext);
     }
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
index d23c9c9d5712..4263a2cc16a2 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper;
@@ -48,7 +51,7 @@ class DateViewHelperTest extends UnitTestCase
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] = 'Y-m-d';
         $this->subject = $this->getAccessibleMock(DateViewHelper::class, array('renderChildren'));
         /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->subject->_set('renderingContext', $renderingContext);
     }
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesDecodeViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesDecodeViewHelperTest.php
index ec038ad8a30e..90bdc06f37ba 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesDecodeViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesDecodeViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper;
@@ -30,18 +32,10 @@ class HtmlentitiesDecodeViewHelperTest extends UnitTestCase
         $this->viewHelper = $this->getMock(HtmlentitiesDecodeViewHelper::class, array('renderChildren'));
 
         /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->viewHelper->setRenderingContext($renderingContext);
     }
 
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->viewHelper->isEscapingInterceptorEnabled());
-    }
-
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesViewHelperTest.php
index 40e606c7616b..9b5a1cc730cf 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlentitiesViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test case
@@ -27,14 +30,6 @@ class HtmlentitiesViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->viewHelper->expects($this->any())->method('resolveDefaultEncoding')->will($this->returnValue('UTF-8'));
     }
 
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->viewHelper->isEscapingInterceptorEnabled());
-    }
-
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php
deleted file mode 100644
index 01ecf45ea571..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-use TYPO3\CMS\Core\Tests\UnitTestCase;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
-use TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper;
-
-/**
- * Test case
- */
-class HtmlspecialcharsViewHelperTest extends UnitTestCase
-{
-    /**
-     * @var HtmlspecialcharsViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        $this->viewHelper = $this->getMock(HtmlspecialcharsViewHelper::class, array('renderChildren'));
-        /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
-        $this->viewHelper->setRenderingContext($renderingContext);
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->viewHelper->isEscapingInterceptorEnabled());
-    }
-
-    /**
-     * @test
-     */
-    public function renderUsesValueAsSourceIfSpecified()
-    {
-        $this->viewHelper->expects($this->never())->method('renderChildren');
-        $actualResult = $this->viewHelper->render('Some string');
-        $this->assertEquals('Some string', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderUsesChildnodesAsSourceIfSpecified()
-    {
-        $this->viewHelper->expects($this->atLeastOnce())->method('renderChildren')->will($this->returnValue('Some string'));
-        $actualResult = $this->viewHelper->render();
-        $this->assertEquals('Some string', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderDoesNotModifyValueIfItDoesNotContainSpecialCharacters()
-    {
-        $source = 'This is a sample text without special characters.';
-        $actualResult = $this->viewHelper->render($source);
-        $this->assertSame($source, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderDecodesSimpleString()
-    {
-        $source = 'Some special characters: &©"\'';
-        $expectedResult = 'Some special characters: &amp;©&quot;\'';
-        $actualResult = $this->viewHelper->render($source);
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderRespectsKeepQuoteArgument()
-    {
-        $source = 'Some special characters: &©"\'';
-        $expectedResult = 'Some special characters: &amp;©"\'';
-        $actualResult = $this->viewHelper->render($source, true);
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderRespectsEncodingArgument()
-    {
-        $source = utf8_decode('Some special characters: &"\'');
-        $expectedResult = 'Some special characters: &amp;&quot;\'';
-        $actualResult = $this->viewHelper->render($source, false, 'ISO-8859-1');
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderConvertsAlreadyConvertedEntitiesByDefault()
-    {
-        $source = 'already &quot;encoded&quot;';
-        $expectedResult = 'already &amp;quot;encoded&amp;quot;';
-        $actualResult = $this->viewHelper->render($source);
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderDoesNotConvertAlreadyConvertedEntitiesIfDoubleQuoteIsFalse()
-    {
-        $source = 'already &quot;encoded&quot;';
-        $expectedResult = 'already &quot;encoded&quot;';
-        $actualResult = $this->viewHelper->render($source, false, 'UTF-8', false);
-        $this->assertEquals($expectedResult, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsUnmodifiedSourceIfItIsNoString()
-    {
-        $source = new \stdClass();
-        $actualResult = $this->viewHelper->render($source);
-        $this->assertSame($source, $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/Nl2brViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/Nl2brViewHelperTest.php
index f2d10dc04b6e..263ff1fd409a 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/Nl2brViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/Nl2brViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\Nl2brViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/NumberViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/NumberViewHelperTest.php
index 3bbee5d44218..a04666018e6a 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/NumberViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/NumberViewHelperTest.php
@@ -1,17 +1,19 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Tests\UnitTestCase;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper;
 
 /**
@@ -28,7 +30,7 @@ class NumberViewHelperTest extends UnitTestCase
     {
         $this->fixture = $this->getMock(NumberViewHelper::class, array('renderChildren'));
         $this->fixture->expects($this->once())->method('renderChildren')->will($this->returnValue(10000.0 / 3.0));
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->fixture->setRenderingContext($renderingContext);
     }
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PaddingViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PaddingViewHelperTest.php
index 18c4f0903efa..679a8bf963b1 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PaddingViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PaddingViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\PaddingViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PrintfViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PrintfViewHelperTest.php
deleted file mode 100644
index 9357da7bb1b6..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/PrintfViewHelperTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
-use TYPO3\CMS\Fluid\ViewHelpers\Format\PrintfViewHelper;
-
-/**
- * Test case
- */
-class PrintfViewHelperTest extends ViewHelperBaseTestcase
-{
-    /**
-     * @var PrintfViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getMock(PrintfViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperCanUseArrayAsArgument()
-    {
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('%04d-%02d-%02d'));
-        $actualResult = $this->viewHelper->render(array('year' => 2009, 'month' => 4, 'day' => 5));
-        $this->assertEquals('2009-04-05', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperCanSwapMultipleArguments()
-    {
-        $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('%2$s %1$d %3$s %2$s'));
-        $actualResult = $this->viewHelper->render(array(123, 'foo', 'bar'));
-        $this->assertEquals('foo 123 bar foo', $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/RawViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/RawViewHelperTest.php
deleted file mode 100644
index e56b873ceba8..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/RawViewHelperTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
-use TYPO3\CMS\Fluid\ViewHelpers\Format\RawViewHelper;
-
-/**
- * Test case
- */
-class RawViewHelperTest extends ViewHelperBaseTestcase
-{
-    /**
-     * @var RawViewHelper|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $subject;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->subject = $this->getMock(RawViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->subject);
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->subject->isEscapingInterceptorEnabled());
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsUnmodifiedValueIfSpecified()
-    {
-        $value = 'input value " & äöüß@';
-        $this->subject->expects($this->never())->method('renderChildren');
-        $actualResult = $this->subject->render($value);
-        $this->assertEquals($value, $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsUnmodifiedChildNodesIfNoValueIsSpecified()
-    {
-        $childNodes = 'input value " & äöüß@';
-        $this->subject->expects($this->once())->method('renderChildren')->will($this->returnValue($childNodes));
-        $actualResult = $this->subject->render();
-        $this->assertEquals($childNodes, $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/StripTagsViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/StripTagsViewHelperTest.php
index c72b8102f0ea..84a21349a305 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/StripTagsViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/StripTagsViewHelperTest.php
@@ -1,16 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 
 /**
@@ -31,14 +33,6 @@ class StripTagsViewHelperTest extends ViewHelperBaseTestcase
         $this->viewHelper->initializeArguments();
     }
 
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->viewHelper->isEscapingInterceptorEnabled());
-    }
-
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/UrlencodeViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/UrlencodeViewHelperTest.php
index 807639b5c316..8a9fa9954e51 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/UrlencodeViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/UrlencodeViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper;
@@ -29,18 +32,10 @@ class UrlencodeViewHelperTest extends UnitTestCase
         $this->viewHelper = $this->getMock(UrlencodeViewHelper::class, array('renderChildren'));
 
         /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->viewHelper->setRenderingContext($renderingContext);
     }
 
-    /**
-     * @test
-     */
-    public function viewHelperDeactivatesEscapingInterceptor()
-    {
-        $this->assertFalse($this->viewHelper->isEscapingInterceptorEnabled());
-    }
-
     /**
      * @test
      */
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/GroupedForViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/GroupedForViewHelperTest.php
deleted file mode 100644
index b26e57454808..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/GroupedForViewHelperTest.php
+++ /dev/null
@@ -1,315 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for GroupedForViewHelper.
- */
-class GroupedForViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\GroupedForViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\GroupedForViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsEmptyStringIfObjectIsNull()
-    {
-        $this->assertEquals('', $this->viewHelper->render(null, 'foo', 'bar'));
-    }
-
-    /**
-     * @test
-     */
-    public function renderReturnsEmptyStringIfObjectIsEmptyArray()
-    {
-        $this->assertEquals('', $this->viewHelper->render(array(), 'foo', 'bar'));
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionWhenPassingObjectsToEachThatAreNotTraversable()
-    {
-        $object = new \stdClass();
-
-        $this->viewHelper->render($object, 'innerVariable', 'someKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalArrayAndPreservesKeys()
-    {
-        $photoshop = array('name' => 'Adobe Photoshop', 'license' => 'commercial');
-        $typo3 = array('name' => 'TYPO3', 'license' => 'GPL');
-        $office = array('name' => 'Microsoft Office', 'license' => 'commercial');
-        $drupal = array('name' => 'Drupal', 'license' => 'GPL');
-        $wordpress = array('name' => 'Wordpress', 'license' => 'GPL');
-
-        $products = array('photoshop' => $photoshop, 'typo3' => $typo3, 'office' => $office, 'drupal' => $drupal, 'wordpress' => $wordpress);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', 'commercial');
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('products', array('photoshop' => $photoshop, 'office' => $office));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('products');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', 'GPL');
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('products', array('typo3' => $typo3, 'drupal' => $drupal, 'wordpress' => $wordpress));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('products');
-
-        $this->viewHelper->render($products, 'products', 'license', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalArrayObjectAndPreservesKeys()
-    {
-        $photoshop = new \ArrayObject(array('name' => 'Adobe Photoshop', 'license' => 'commercial'));
-        $typo3 = new \ArrayObject(array('name' => 'TYPO3', 'license' => 'GPL'));
-        $office = new \ArrayObject(array('name' => 'Microsoft Office', 'license' => 'commercial'));
-        $drupal = new \ArrayObject(array('name' => 'Drupal', 'license' => 'GPL'));
-        $wordpress = new \ArrayObject(array('name' => 'Wordpress', 'license' => 'GPL'));
-
-        $products = new \ArrayObject(array('photoshop' => $photoshop, 'typo3' => $typo3, 'office' => $office, 'drupal' => $drupal, 'wordpress' => $wordpress));
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', 'commercial');
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('products', array('photoshop' => $photoshop, 'office' => $office));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('products');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', 'GPL');
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('products', array('typo3' => $typo3, 'drupal' => $drupal, 'wordpress' => $wordpress));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('products');
-
-        $this->viewHelper->render($products, 'products', 'license', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsArrayOfObjectsAndPreservesKeys()
-    {
-        $photoshop = new \stdClass();
-        $photoshop->name = 'Adobe Photoshop';
-        $photoshop->license = 'commercial';
-        $typo3 = new \stdClass();
-        $typo3->name = 'TYPO3';
-        $typo3->license = 'GPL';
-        $office = new \stdClass();
-        $office->name = 'Microsoft Office';
-        $office->license = 'commercial';
-        $drupal = new \stdClass();
-        $drupal->name = 'Drupal';
-        $drupal->license = 'GPL';
-        $wordpress = new \stdClass();
-        $wordpress->name = 'Wordpress';
-        $wordpress->license = 'GPL';
-
-        $products = array('photoshop' => $photoshop, 'typo3' => $typo3, 'office' => $office, 'drupal' => $drupal, 'wordpress' => $wordpress);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', 'commercial');
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('products', array('photoshop' => $photoshop, 'office' => $office));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('products');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', 'GPL');
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('products', array('typo3' => $typo3, 'drupal' => $drupal, 'wordpress' => $wordpress));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('products');
-
-        $this->viewHelper->render($products, 'products', 'license', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalArrayByObjectKey()
-    {
-        $customer1 = new \stdClass();
-        $customer1->name = 'Anton Abel';
-
-        $customer2 = new \stdClass();
-        $customer2->name = 'Balthasar Bux';
-
-        $invoice1 = array('date' => new \DateTime('1980-12-13'), 'customer' => $customer1);
-        $invoice2 = array('date' => new \DateTime('2010-07-01'), 'customer' => $customer1);
-        $invoice3 = array('date' => new \DateTime('2010-07-04'), 'customer' => $customer2);
-
-        $invoices = array('invoice1' => $invoice1, 'invoice2' => $invoice2, 'invoice3' => $invoice3);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', $customer1);
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('invoices', array('invoice1' => $invoice1, 'invoice2' => $invoice2));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('invoices');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', $customer2);
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('invoices', array('invoice3' => $invoice3));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('invoices');
-
-        $this->viewHelper->render($invoices, 'invoices', 'customer', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalArrayByPropertyPath()
-    {
-        $customer1 = new \stdClass();
-        $customer1->name = 'Anton Abel';
-
-        $customer2 = new \stdClass();
-        $customer2->name = 'Balthasar Bux';
-
-        $invoice1 = new \stdClass();
-        $invoice1->customer = $customer1;
-
-        $invoice2 = new \stdClass();
-        $invoice2->customer = $customer1;
-
-        $invoice3 = new \stdClass();
-        $invoice3->customer = $customer2;
-
-        $invoices = array('invoice1' => $invoice1, 'invoice2' => $invoice2, 'invoice3' => $invoice3);
-        $groupBy = 'customer.name';
-        /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Fluid\ViewHelpers\GroupedForViewHelper $accessibleMock */
-        $accessibleMock = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\GroupedForViewHelper::class, array('dummy'));
-        $expectedResult = array(
-            'keys' => array(
-                'Anton Abel' => 'Anton Abel',
-                'Balthasar Bux' => 'Balthasar Bux'
-            ),
-            'values' => array(
-                'Anton Abel' => array(
-                    'invoice1' => $invoice1,
-                    'invoice2' => $invoice2
-                ),
-                'Balthasar Bux' => array(
-                    'invoice3' => $invoice3
-                )
-            )
-        );
-        $this->assertSame($expectedResult, $accessibleMock->_callRef('groupElements', $invoices, $groupBy));
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalObjectByObjectKey()
-    {
-        $customer1 = new \stdClass();
-        $customer1->name = 'Anton Abel';
-
-        $customer2 = new \stdClass();
-        $customer2->name = 'Balthasar Bux';
-
-        $invoice1 = new \stdClass();
-        $invoice1->date = new \DateTime('1980-12-13');
-        $invoice1->customer = $customer1;
-
-        $invoice2 = new \stdClass();
-        $invoice2->date = new \DateTime('2010-07-01');
-        $invoice2->customer = $customer1;
-
-        $invoice3 = new \stdClass();
-        $invoice3->date = new \DateTime('2010-07-04');
-        $invoice3->customer = $customer2;
-
-        $invoices = array('invoice1' => $invoice1, 'invoice2' => $invoice2, 'invoice3' => $invoice3);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', $customer1);
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('invoices', array('invoice1' => $invoice1, 'invoice2' => $invoice2));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('invoices');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', $customer2);
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('invoices', array('invoice3' => $invoice3));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('invoices');
-
-        $this->viewHelper->render($invoices, 'invoices', 'customer', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function renderGroupsMultidimensionalObjectByDateTimeObject()
-    {
-        $date1 = new \DateTime('2010-07-01');
-        $date2 = new \DateTime('2010-07-04');
-
-        $invoice1 = new \stdClass();
-        $invoice1->date = $date1;
-        $invoice1->id = 12340;
-
-        $invoice2 = new \stdClass();
-        $invoice2->date = $date1;
-        $invoice2->id = 12341;
-
-        $invoice3 = new \stdClass();
-        $invoice3->date = $date2;
-        $invoice3->id = 12342;
-
-        $invoices = array('invoice1' => $invoice1, 'invoice2' => $invoice2, 'invoice3' => $invoice3);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('myGroupKey', $date1);
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('invoices', array('invoice1' => $invoice1, 'invoice2' => $invoice2));
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('invoices');
-        $this->templateVariableContainer->expects($this->at(4))->method('add')->with('myGroupKey', $date2);
-        $this->templateVariableContainer->expects($this->at(5))->method('add')->with('invoices', array('invoice3' => $invoice3));
-        $this->templateVariableContainer->expects($this->at(6))->method('remove')->with('myGroupKey');
-        $this->templateVariableContainer->expects($this->at(7))->method('remove')->with('invoices');
-
-        $this->viewHelper->render($invoices, 'invoices', 'date', 'myGroupKey');
-    }
-
-    /**
-     * @test
-     */
-    public function groupingByAKeyThatDoesNotExistCreatesASingleGroup()
-    {
-        $photoshop = array('name' => 'Adobe Photoshop', 'license' => 'commercial');
-        $typo3 = array('name' => 'TYPO3', 'license' => 'GPL');
-        $office = array('name' => 'Microsoft Office', 'license' => 'commercial');
-
-        $products = array('photoshop' => $photoshop, 'typo3' => $typo3, 'office' => $office);
-
-        $this->templateVariableContainer->expects($this->at(0))->method('add')->with('groupKey', null);
-        $this->templateVariableContainer->expects($this->at(1))->method('add')->with('innerKey', $products);
-        $this->templateVariableContainer->expects($this->at(2))->method('remove')->with('groupKey');
-        $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('innerKey');
-
-        $this->viewHelper->render($products, 'innerKey', 'NonExistingKey');
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
-     */
-    public function renderThrowsExceptionWhenPassingOneDimensionalArraysToEach()
-    {
-        $values = array('some', 'simple', 'array');
-
-        $this->viewHelper->render($values, 'innerVariable', 'someKey');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/IfViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/IfViewHelperTest.php
deleted file mode 100644
index 4f9d78589c3f..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/IfViewHelperTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for IfViewHelper
- */
-class IfViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper
-     */
-    protected $viewHelper;
-
-    /**
-     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\Arguments
-     */
-    protected $mockArguments;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper::class, array('renderThenChild', 'renderElseChild'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperRendersThenChildIfConditionIsTrue()
-    {
-        $this->arguments['condition'] = true;
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-
-        $this->viewHelper->expects($this->at(0))->method('renderThenChild')->will($this->returnValue('foo'));
-
-        $actualResult = $this->viewHelper->render(true);
-        $this->assertEquals('foo', $actualResult);
-    }
-
-    /**
-     * @test
-     */
-    public function viewHelperRendersElseChildIfConditionIsFalse()
-    {
-        $this->viewHelper->expects($this->at(0))->method('renderElseChild')->will($this->returnValue('foo'));
-
-        $actualResult = $this->viewHelper->render(false);
-        $this->assertEquals('foo', $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ImageViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ImageViewHelperTest.php
new file mode 100644
index 000000000000..23182d079ec1
--- /dev/null
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ImageViewHelperTest.php
@@ -0,0 +1,166 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
+
+/*
+ * 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!
+ */
+use TYPO3\CMS\Core\Resource\FileReference;
+use TYPO3\CMS\Extbase\Service\ImageService;
+use TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper;
+use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;
+
+/**
+ * Test case
+ */
+class ImageViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
+{
+    /**
+     * @test
+     */
+    public function registersExpectedArgumentsInInitializeArgumentsMethod()
+    {
+        $mock = $this->getMock(ImageViewHelper::class, array('registerUniversalTagAttributes', 'registerTagAttribute'));
+        $mock->expects($this->at(0))->method('registerUniversalTagAttributes');
+        $mock->expects($this->at(1))->method('registerTagAttribute')->with('alt', 'string', $this->anything(), false);
+        $mock->expects($this->at(2))->method('registerTagAttribute')->with('ismap', 'string', $this->anything(), false);
+        $mock->expects($this->at(3))->method('registerTagAttribute')->with('longdesc', 'string', $this->anything(), false);
+        $mock->expects($this->at(4))->method('registerTagAttribute')->with('usemap', 'string', $this->anything(), false);
+        $mock->initializeArguments();
+    }
+
+    /**
+     * @test
+     * @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
+     * @dataProvider getInvalidArguments
+     * @param array $arguments
+     */
+    public function renderMethodThrowsExceptionOnInvalidArguments(array $arguments)
+    {
+        $mock = $this->getMock(ImageViewHelper::class, array('dummy'));
+        $mock->setArguments($arguments);
+        $mock->render(
+            isset($arguments['src']) ? $arguments['src'] : null,
+            isset($arguments['width']) ? $arguments['width'] : null,
+            isset($arguments['height']) ? $arguments['height'] : null,
+            isset($arguments['minWidth']) ? $arguments['minWidth'] : null,
+            isset($arguments['minHeight']) ? $arguments['minHeight'] : null,
+            isset($arguments['maxWidth']) ? $arguments['maxWidth'] : null,
+            isset($arguments['maxHeight']) ? $arguments['maxHeight'] : null,
+            isset($arguments['treatIdAsReference']) ? $arguments['treatIdAsReference'] : null,
+            isset($arguments['image']) ? $arguments['image'] : null,
+            isset($arguments['crop']) ? $arguments['crop'] : null
+        );
+    }
+
+    /**
+     * @return array
+     */
+    public function getInvalidArguments()
+    {
+        return array(
+            array(array('image' => null)),
+            array(array('src' => null)),
+            array(array('src' => 'something', 'image' => 'something')),
+        );
+    }
+
+    /**
+     * @test
+     * @dataProvider getRenderMethodTestValues
+     * @param array $arguments
+     * @param array $expected
+     */
+    public function renderMethodCreatesExpectedTag(array $arguments, array $expected)
+    {
+        $image = $this->getMock(FileReference::class, array('getProperty'), array(), '', false);
+        $image->expects($this->any())->method('getProperty')->willReturnMap(array(
+            array('width', $arguments['width']),
+            array('height', $arguments['height']),
+            array('alternative', 'alternative'),
+            array('title', 'title'),
+            array('crop', 'crop')
+        ));
+        $imageService = $this->getMock(ImageService::class, array('getImage', 'applyProcessingInstructions', 'getImageUri'));
+        $imageService->expects($this->once())->method('getImage')->willReturn($image);
+        $imageService->expects($this->once())->method('applyProcessingInstructions')->with($image, $this->anything())->willReturn($image);
+        $imageService->expects($this->once())->method('getImageUri')->with($image)->willReturn('test.png');
+        $tagBuilder = $this->getMock(TagBuilder::class, array('addAttribute', 'render'));
+        $index = -1;
+        foreach ($expected as $expectedAttribute => $expectedValue) {
+            $tagBuilder->expects($this->at(++ $index))->method('addAttribute')->with($expectedAttribute, $expectedValue);
+        }
+        $tagBuilder->expects($this->once())->method('render');
+        $mock = $this->getAccessibleMock(ImageViewHelper::class, array('dummy'), array(), '', false);
+        $mock->_set('imageService', $imageService);
+        $mock->_set('tag', $tagBuilder);
+        $mock->setArguments($arguments);
+        $mock->render(
+            isset($arguments['src']) ? $arguments['src'] : null,
+            isset($arguments['width']) ? $arguments['width'] : null,
+            isset($arguments['height']) ? $arguments['height'] : null,
+            isset($arguments['minWidth']) ? $arguments['minWidth'] : null,
+            isset($arguments['minHeight']) ? $arguments['minHeight'] : null,
+            isset($arguments['maxWidth']) ? $arguments['maxWidth'] : null,
+            isset($arguments['maxHeight']) ? $arguments['maxHeight'] : null,
+            isset($arguments['treatIdAsReference']) ? $arguments['treatIdAsReference'] : null,
+            isset($arguments['image']) ? $arguments['image'] : null,
+            isset($arguments['crop']) ? $arguments['crop'] : null
+        );
+    }
+
+    /**
+     * @return array
+     */
+    public function getRenderMethodTestValues()
+    {
+        return array(
+            array(
+                array(
+                    'src' => 'test',
+                    'width' => 100,
+                    'height' => 200,
+                    'minWidth' => 300,
+                    'maxWidth' => 400,
+                    'minHeight' => 500,
+                    'maxHeight' => 600,
+                    'crop' => false
+                ),
+                array(
+                    'src' => 'test.png',
+                    'width' => '100',
+                    'height' => '200',
+                    'alt' => 'alternative',
+                    'title' => 'title'
+                )
+            ),
+            array(
+                array(
+                    'src' => 'test',
+                    'width' => 100,
+                    'height' => 200,
+                    'minWidth' => 300,
+                    'maxWidth' => 400,
+                    'minHeight' => 500,
+                    'maxHeight' => 600,
+                    'crop' => null
+                ),
+                array(
+                    'src' => 'test.png',
+                    'width' => '100',
+                    'height' => '200',
+                    'alt' => 'alternative',
+                    'title' => 'title'
+                )
+            ),
+        );
+    }
+}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/EmailViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/EmailViewHelperTest.php
index f6a7be64c6bf..d6657a94c827 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/EmailViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/EmailViewHelperTest.php
@@ -1,21 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
-
+ * Test case
  */
 class EmailViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
 {
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/ExternalViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/ExternalViewHelperTest.php
index f829e9718518..a5f0ce8b5aca 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/ExternalViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/ExternalViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Test for \TYPO3\CMS\Fluid\ViewHelpers\Link\EmailViewHelper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/PageViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/PageViewHelperTest.php
index a40af2ed8026..a48f1984b294 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/PageViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/PageViewHelperTest.php
@@ -1,19 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper;
 
 /**
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
index 06064d4fcb0f..4c1c7ca0aaa3 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
@@ -1,19 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
@@ -37,7 +36,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase
     {
         $this->subject = $this->getAccessibleMock(TypolinkViewHelper::class, array('renderChildren'));
         /** @var RenderingContext  $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
         $this->subject->setRenderingContext($renderingContext);
     }
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderChildrenViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderChildrenViewHelperTest.php
deleted file mode 100644
index 68be6729776b..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderChildrenViewHelperTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for RenderChildren ViewHelper
- */
-class RenderChildrenViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\RenderChildrenViewHelper
-     */
-    protected $viewHelper;
-
-    /**
-
-     */
-    protected function setUp()
-    {
-        $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\RenderChildrenViewHelper::class, array('renderChildren'));
-        $this->viewHelper->_set('controllerContext', $this->controllerContext);
-    }
-
-    /**
-     * @test
-     */
-    public function renderCallsEvaluateOnTheRootNodeAndRegistersTheArguments()
-    {
-        $this->request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
-        $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
-        $this->viewHelper->initializeArguments();
-        $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
-        $templateVariableContainer->expects($this->at(0))->method('add')->with('k1', 'v1');
-        $templateVariableContainer->expects($this->at(1))->method('add')->with('k2', 'v2');
-        $templateVariableContainer->expects($this->at(2))->method('remove')->with('k1');
-        $templateVariableContainer->expects($this->at(3))->method('remove')->with('k2');
-        $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
-        $renderingContext->expects($this->any())->method('getTemplateVariableContainer')->will($this->returnValue($templateVariableContainer));
-        $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
-        $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
-        $this->request->expects($this->any())->method('getWidgetContext')->will($this->returnValue($widgetContext));
-        $widgetContext->expects($this->any())->method('getViewHelperChildNodeRenderingContext')->will($this->returnValue($renderingContext));
-        $widgetContext->expects($this->any())->method('getViewHelperChildNodes')->will($this->returnValue($rootNode));
-        $rootNode->expects($this->any())->method('evaluate')->with($renderingContext)->will($this->returnValue('Rendered Results'));
-        $output = $this->viewHelper->render(array('k1' => 'v1', 'k2' => 'v2'));
-        $this->assertEquals('Rendered Results', $output);
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Widget\Exception\WidgetRequestNotFoundException
-     */
-    public function renderThrowsExceptionIfTheRequestIsNotAWidgetRequest()
-    {
-        $this->request = $this->getMock('Tx_Fluid_MVC_Request');
-        $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
-        $this->viewHelper->initializeArguments();
-        $this->viewHelper->render();
-    }
-
-    /**
-     * @test
-     * @expectedException \TYPO3\CMS\Fluid\Core\Widget\Exception\RenderingContextNotFoundException
-     */
-    public function renderThrowsExceptionIfTheChildNodeRenderingContextIsNotThere()
-    {
-        $this->request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
-        $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
-        $this->viewHelper->initializeArguments();
-        $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
-        $this->request->expects($this->any())->method('getWidgetContext')->will($this->returnValue($widgetContext));
-        $widgetContext->expects($this->any())->method('getViewHelperChildNodeRenderingContext')->will($this->returnValue(null));
-        $widgetContext->expects($this->any())->method('getViewHelperChildNodes')->will($this->returnValue(null));
-        $this->viewHelper->render();
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderViewHelperTest.php
deleted file mode 100644
index 7e8bc583ebb5..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/RenderViewHelperTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for RenderViewHelper
- */
-class RenderViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->templateVariableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
-        $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
-        $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::class, array('dummy'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-    }
-
-    /**
-     * @test
-     */
-    public function loadSettingsIntoArgumentsSetsSettingsIfNoSettingsAreSpecified()
-    {
-        $arguments = array(
-            'someArgument' => 'someValue'
-        );
-        $expected = array(
-            'someArgument' => 'someValue',
-            'settings' => 'theSettings'
-        );
-        $this->templateVariableContainer->add('settings', 'theSettings');
-
-        $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments, $this->renderingContext);
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function loadSettingsIntoArgumentsDoesNotOverrideGivenSettings()
-    {
-        $arguments = array(
-            'someArgument' => 'someValue',
-            'settings' => 'specifiedSettings'
-        );
-        $expected = array(
-            'someArgument' => 'someValue',
-            'settings' => 'specifiedSettings'
-        );
-        $this->templateVariableContainer->add('settings', 'theSettings');
-
-        $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments, $this->renderingContext);
-        $this->assertEquals($expected, $actual);
-    }
-
-    /**
-     * @test
-     */
-    public function loadSettingsIntoArgumentsDoesNotThrowExceptionIfSettingsAreNotInTemplateVariableContainer()
-    {
-        $arguments = array(
-            'someArgument' => 'someValue'
-        );
-        $expected = array(
-            'someArgument' => 'someValue'
-        );
-
-        $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments, $this->renderingContext);
-        $this->assertEquals($expected, $actual);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfAuthenticatedViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfAuthenticatedViewHelperTest.php
index 8be064b0ece6..9b842b9bcf4f 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfAuthenticatedViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfAuthenticatedViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Security;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Testcase for security.ifAuthenticated view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfHasRoleViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfHasRoleViewHelperTest.php
index ade3321d5824..23bd10f118d5 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfHasRoleViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfHasRoleViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Security;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 
 /**
  * Testcase for security.ifHasRole view helper
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SpacelessViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SpacelessViewHelperTest.php
deleted file mode 100644
index e8ed59d8d485..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SpacelessViewHelperTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\ViewHelpers\SpacelessViewHelper;
-
-/**
- * Testcase for SpacelessViewHelper
- */
-class SpacelessViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @test
-     */
-    public function renderWithEmptyChildNodesReturnsNoOutput()
-    {
-        $instance = new SpacelessViewHelper();
-        $viewHelperNodeProphecy = $this->prophesize(ViewHelperNode::class);
-        $instance->setViewHelperNode($viewHelperNodeProphecy->reveal());
-        $renderingContextInterfaceProphecy = $this->prophesize(RenderingContextInterface::class);
-        $instance->setRenderingContext($renderingContextInterfaceProphecy->reveal());
-        $instance->setArguments([]);
-        // the render method would not return an empty string in a real usage. The render method just
-        // calls renderStatic, which does the actual work. The tests for this are done in the
-        // renderStatic test directly. The render method test only makes sure the method call
-        // raises no fatal error.
-        $this->assertEquals('', $instance->render());
-    }
-
-    /**
-     * @param string $input
-     * @param string $expected
-     *
-     * @dataProvider testRenderStaticDataProvider
-     * @test
-     */
-    public function testRenderStatic($input, $expected)
-    {
-        $context = $this->getMock(RenderingContextInterface::class);
-
-        $this->assertEquals($expected,
-            SpacelessViewHelper::renderStatic([], function () use ($input) {
-                return $input;
-            }, $context));
-    }
-
-    /**
-     * @return array
-     */
-    public function testRenderStaticDataProvider()
-    {
-        return [
-            'extra whitespace between tags' => [
-                '<div>foo</div>  <div>bar</div>',
-                '<div>foo</div><div>bar</div>',
-            ],
-            'whitespace preserved in text node' => [
-                PHP_EOL . '<div>' . PHP_EOL . 'foo</div>',
-                '<div>' . PHP_EOL . 'foo</div>',
-            ],
-            'whitespace removed from non-text node' => [
-                PHP_EOL . '<div>' . PHP_EOL . '<div>foo</div></div>',
-                '<div><div>foo</div></div>',
-            ],
-        ];
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SwitchViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SwitchViewHelperTest.php
deleted file mode 100644
index b8069f24540b..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/SwitchViewHelperTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Testcase for SwitchViewHelper
- */
-class SwitchViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
-{
-    /**
-     * @var \TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper
-     */
-    protected $viewHelper;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->viewHelper);
-        $this->viewHelper->initializeArguments();
-    }
-
-    /**
-     * @test
-     */
-    public function renderSetsSwitchExpressionInViewHelperVariableContainer()
-    {
-        $switchExpression = new \stdClass();
-        $this->viewHelperVariableContainer->expects($this->at(1))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack', array(array(
-            'break' => false,
-            'expression' => $switchExpression
-        )));
-        $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->will($this->returnValue(array(array(
-            'break' => true,
-            'expression' => $switchExpression
-        ))));
-        $this->viewHelper->render($switchExpression);
-    }
-
-    /**
-     * @test
-     */
-    public function renderRemovesSwitchExpressionFromViewHelperVariableContainerAfterInvocation()
-    {
-        $this->viewHelperVariableContainer->expects($this->at(1))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack', array(array(
-            'break' => false,
-            'expression' => 'switchExpression'
-        )));
-        $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->will($this->returnValue(array(array(
-            'break' => true,
-            'expression' => 'switchExpression'
-        ))));
-        $this->viewHelperVariableContainer->expects($this->at(3))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack', array());
-        $this->viewHelper->render('switchExpression');
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ThenViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ThenViewHelperTest.php
deleted file mode 100644
index 81dec241fa8b..000000000000
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ThenViewHelperTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-use TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper;
-
-/**
- * Test case
- */
-class ThenViewHelperTest extends ViewHelperBaseTestcase
-{
-    /**
-     * @var ThenViewHelper|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $subject;
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->subject = $this->getMock(ThenViewHelper::class, array('renderChildren'));
-        $this->injectDependenciesIntoViewHelper($this->subject);
-    }
-
-    /**
-     * @test
-     */
-    public function renderRendersChildren()
-    {
-        $this->subject->expects($this->once())->method('renderChildren')->will($this->returnValue('foo'));
-        $actualResult = $this->subject->render();
-        $this->assertEquals('foo', $actualResult);
-    }
-}
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/TranslateViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/TranslateViewHelperTest.php
index a4b3e5a41e97..9a703421d015 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/TranslateViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/TranslateViewHelperTest.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\TranslateViewHelperFixtureForEmptyString;
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fixtures\TranslateViewHelperFixtureForTranslatedString;
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/EmailViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/EmailViewHelperTest.php
index df670250d75e..70d99531deab 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/EmailViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/EmailViewHelperTest.php
@@ -1,25 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Uri\EmailViewHelper;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/ExternalViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/ExternalViewHelperTest.php
index 34e2548d28a9..c83b4750bc89 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/ExternalViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/ExternalViewHelperTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Uri\ExternalViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/PageViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/PageViewHelperTest.php
index 39f4aa64a072..e34e8ef9cfe5 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/PageViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/PageViewHelperTest.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Uri\PageViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/TypolinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/TypolinkViewHelperTest.php
index dfd45f138f5c..e13d49aec164 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/TypolinkViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Uri/TypolinkViewHelperTest.php
@@ -1,19 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
+/*
+ * 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!
+ */
 use TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;
 use TYPO3\CMS\Fluid\ViewHelpers\Uri\TypolinkViewHelper;
 
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php
index dff158f063a3..6ac7ddf2e0fd 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php
@@ -1,15 +1,21 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU General Public License, either version 3 of the   *
- * License, or (at your option) any later version.                        *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
+use TYPO3\CMS\Fluid\Core\Variables\CmsVariableProvider;
+use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
+use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
 
 /**
  * Base test class for testing view helpers
@@ -52,7 +58,7 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Core\Tests\UnitTestCase
     protected $request;
 
     /**
-     * @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
+     * @var \TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContext
      */
     protected $renderingContext;
 
@@ -67,7 +73,7 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Core\Tests\UnitTestCase
     protected function setUp()
     {
         $this->viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
-        $this->templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
+        $this->templateVariableContainer = $this->getMock(CmsVariableProvider::class);
         $this->uriBuilder = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
         $this->uriBuilder->expects($this->any())->method('reset')->will($this->returnValue($this->uriBuilder));
         $this->uriBuilder->expects($this->any())->method('setArguments')->will($this->returnValue($this->uriBuilder));
@@ -86,24 +92,25 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
         $this->controllerContext->expects($this->any())->method('getUriBuilder')->will($this->returnValue($this->uriBuilder));
         $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
-        $this->tagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class);
+        $this->tagBuilder = $this->getMock(\TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder::class);
         $this->arguments = array();
-        $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
-        $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
+        $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class, array('getControllerContext'));
+        $this->renderingContext->expects($this->any())->method('getControllerContext')->willReturn($this->controllerContext);
+        $this->renderingContext->setVariableProvider($this->templateVariableContainer);
         $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
         $this->renderingContext->setControllerContext($this->controllerContext);
         $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class, array('dummy'));
     }
 
     /**
-     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper
+     * @param ViewHelperInterface $viewHelper
      * @return void
      */
-    protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
+    protected function injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper)
     {
         $viewHelper->setRenderingContext($this->renderingContext);
         $viewHelper->setArguments($this->arguments);
-        if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper) {
+        if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper || $viewHelper instanceof AbstractTagBasedViewHelper) {
             $viewHelper->_set('tag', $this->tagBuilder);
         }
     }
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php
index 177f47586f54..d159fc59a892 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php
@@ -1,15 +1,18 @@
 <?php
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Widget\Controller;
 
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
+/*
+ * 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!
+ */
 use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
 
 /**
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html
index d384cdc949f1..b9b02ed01d25 100644
--- a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html
+++ b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html
@@ -21,13 +21,13 @@
 	<f:case value="100">
 		<f:comment> -- do not show header -- </f:comment>
 	</f:case>
-	<f:case default="true">
+	<f:defaultCase>
 		<f:if condition="{default}">
 			<f:render partial="Header/Header" arguments="{
 				header: header,
 				layout: default,
 				link: link}" />
 		</f:if>
-	</f:case>
+	</f:defaultCase>
 </f:switch>
-</html>
\ No newline at end of file
+</html>
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/SubHeader.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/SubHeader.html
index 79495c7175a4..dc117ee9ddd0 100644
--- a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/SubHeader.html
+++ b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/SubHeader.html
@@ -15,12 +15,12 @@
 	<f:case value="5">
 		<h6>{subheader}</h6>
 	</f:case>
-	<f:case default="true">
+	<f:defaultCase>
 		<f:if condition="{default}">
 			<f:render partial="Header/SubHeader" arguments="{
 				subheader: subheader,
 				layout: default}" />
 		</f:if>
-	</f:case>
+	</f:defaultCase>
 </f:switch>
-</html>
\ No newline at end of file
+</html>
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/MediaGallery.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/MediaGallery.html
index a6e25d005c70..02270c3af2fd 100644
--- a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/MediaGallery.html
+++ b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/MediaGallery.html
@@ -26,9 +26,9 @@
 								<f:case value="4">
 									<f:render section="videoType" arguments="{_all}" />
 								</f:case>
-								<f:case default="TRUE">
+								<f:defaultCase>
 									<f:render section="imageType" arguments="{_all}" />
-								</f:case>
+								</f:defaultCase>
 							 </f:switch>
 
 							<f:if condition="{column.media.description}">
diff --git a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/DateTimeViewHelper.php b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/DateTimeViewHelper.php
index 328b492ddca8..2c407669496a 100644
--- a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/DateTimeViewHelper.php
+++ b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/DateTimeViewHelper.php
@@ -17,12 +17,11 @@ namespace TYPO3\CMS\IndexedSearch\ViewHelpers\Format;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * DateTime viewhelper
  */
-class DateTimeViewHelper extends AbstractViewHelper implements CompilableInterface
+class DateTimeViewHelper extends AbstractViewHelper
 {
     /**
      * Render the given timestamp as date & time
diff --git a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/FlagValueViewHelper.php b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/FlagValueViewHelper.php
index cc850d48c257..39d8887fe142 100644
--- a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/FlagValueViewHelper.php
+++ b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/FlagValueViewHelper.php
@@ -16,12 +16,11 @@ namespace TYPO3\CMS\IndexedSearch\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * FlagValue viewhelper
  */
-class FlagValueViewHelper extends AbstractViewHelper implements CompilableInterface
+class FlagValueViewHelper extends AbstractViewHelper
 {
     /**
      * Render additional flag information
diff --git a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/GroupListViewHelper.php b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/GroupListViewHelper.php
index eea86cd50a94..b9be2c9a8909 100644
--- a/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/GroupListViewHelper.php
+++ b/typo3/sysext/indexed_search/Classes/ViewHelpers/Format/GroupListViewHelper.php
@@ -16,12 +16,11 @@ namespace TYPO3\CMS\IndexedSearch\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Group list viewhelper
  */
-class GroupListViewHelper extends AbstractViewHelper implements CompilableInterface
+class GroupListViewHelper extends AbstractViewHelper
 {
     /**
      * Render the given group information as string
diff --git a/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingResultsViewHelper.php b/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingResultsViewHelper.php
index 7426aa00a014..779437b39708 100644
--- a/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingResultsViewHelper.php
+++ b/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingResultsViewHelper.php
@@ -17,13 +17,12 @@ namespace TYPO3\CMS\IndexedSearch\ViewHelpers;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * renders the header of the results page
  * @internal
  */
-class PageBrowsingResultsViewHelper extends AbstractViewHelper implements CompilableInterface
+class PageBrowsingResultsViewHelper extends AbstractViewHelper
 {
     /**
      * main render function
diff --git a/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingViewHelper.php b/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingViewHelper.php
index 6f21495fa8b5..f6e735ae08eb 100644
--- a/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingViewHelper.php
+++ b/typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingViewHelper.php
@@ -19,7 +19,6 @@ use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Page browser for indexed search, and only useful here, as the
@@ -28,7 +27,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  * functionality
  * @internal
  */
-class PageBrowsingViewHelper extends AbstractViewHelper implements CompilableInterface
+class PageBrowsingViewHelper extends AbstractViewHelper
 {
     /**
      * @var string
diff --git a/typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Statistic.html b/typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Statistic.html
index c3855687da2b..b5f78b168dbe 100644
--- a/typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Statistic.html
+++ b/typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Statistic.html
@@ -38,7 +38,7 @@
 									<f:translate key="field.words" />
 								</th>
 							</f:case>
-							<f:case default="TRUE">
+							<f:defaultCase>
 								<th>
 									<f:translate key="field.wordCount"/>
 								</th>
@@ -48,7 +48,7 @@
 								<th>
 									<f:translate key="field.indexed"/>
 								</th>
-							</f:case>
+							</f:defaultCase>
 						</f:switch>
 					</tr>
 				</thead>
@@ -85,7 +85,7 @@
 														<em>{f:translate(key:'administration.statistics.count')}: {f:count(subject:l.allWords)}</em>
 													</td>
 												</f:case>
-												<f:case default="TRUE">
+												<f:defaultCase>
 													<td>{l.wordCount}</td>
 													<td>
 														<f:format.bytes decimals="1">{l.item_size}</f:format.bytes>
@@ -93,7 +93,7 @@
 													<td>
 														<is:format.dateTime>{l.tstamp}</is:format.dateTime>
 													</td>
-												</f:case>
+												</f:defaultCase>
 											</f:switch>
 										</f:then>
 									</tr>
@@ -108,11 +108,11 @@
 												<f:translate key="administration.notIndexed" />
 											</td>
 										</f:case>
-										<f:case default="TRUE">
+										<f:defaultCase>
 											<td colspan="5">
 												<f:translate key="administration.notIndexed"/>
 											</td>
-										</f:case>
+										</f:defaultCase>
 									</f:switch>
 								</tr>
 							</f:else>
@@ -125,4 +125,4 @@
 			<h2><f:translate key="administration.noPageSelected"/></h2>
 		</f:else>
 	</f:if>
-</f:section>
\ No newline at end of file
+</f:section>
diff --git a/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php b/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
index e454ab7c32ec..44e853008a2e 100644
--- a/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
+++ b/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Install\Controller\Action;
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Install\View\StandaloneView;
+use TYPO3\CMS\Fluid\View\StandaloneView;
 
 /**
  * General purpose controller action helper methods and bootstrap
diff --git a/typo3/sysext/install/Classes/View/StandaloneView.php b/typo3/sysext/install/Classes/View/StandaloneView.php
deleted file mode 100644
index 55b8befdf08b..000000000000
--- a/typo3/sysext/install/Classes/View/StandaloneView.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\View;
-
-/*
- * 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!
- */
-
-/**
- * A standalone fluid view with reduced functionality for ext:install
- *
- * In contrast to the parent class, this StandaloneView does not
- * bootstrap a frontend, so some view helper like f:link will not work.
- */
-class StandaloneView extends \TYPO3\CMS\Fluid\View\StandaloneView
-{
-    /**
-     * Constructor
-     */
-    public function __construct()
-    {
-        $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $this->templateParser = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class);
-        $this->setRenderingContext($this->objectManager->get(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class));
-        $request = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
-        $request->setRequestURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
-        $request->setBaseURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
-        $uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
-        $uriBuilder->setRequest($request);
-        $controllerContext = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class);
-        $controllerContext->setRequest($request);
-        $controllerContext->setUriBuilder($uriBuilder);
-        $this->setControllerContext($controllerContext);
-        $this->templateCompiler = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler::class);
-        $this->templateCompiler->setTemplateCache(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('fluid_template'));
-    }
-}
diff --git a/typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php
index 7bc396a02d26..3899099496b3 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php
@@ -41,6 +41,16 @@ namespace TYPO3\CMS\Install\ViewHelpers\Be;
  */
 class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper
 {
+    /**
+     * @var bool
+     */
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
+
     /**
      * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
      *
diff --git a/typo3/sysext/install/Classes/ViewHelpers/ConstantViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/ConstantViewHelper.php
index 9dc0f89b96ee..40553f801115 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/ConstantViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/ConstantViewHelper.php
@@ -16,14 +16,13 @@ namespace TYPO3\CMS\Install\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Render value of a constant
  *
  * @internal
  */
-class ConstantViewHelper extends AbstractViewHelper implements CompilableInterface
+class ConstantViewHelper extends AbstractViewHelper
 {
     /**
      * Render a constant
diff --git a/typo3/sysext/install/Classes/ViewHelpers/File/ExistsViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/File/ExistsViewHelper.php
index 9ed6d4dc20b7..855037f0c98d 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/File/ExistsViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/File/ExistsViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\File;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Simple view helper to check if given file is a regular file
@@ -33,7 +32,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class ExistsViewHelper extends AbstractViewHelper implements CompilableInterface
+class ExistsViewHelper extends AbstractViewHelper
 {
     /**
      * Check if given file is a regular file
diff --git a/typo3/sysext/install/Classes/ViewHelpers/File/ImageDimensionViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/File/ImageDimensionViewHelper.php
index 4f522ca9ff4d..4e97b72e8454 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/File/ImageDimensionViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/File/ImageDimensionViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\File;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get width or height from image file
@@ -32,7 +31,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class ImageDimensionViewHelper extends AbstractViewHelper implements CompilableInterface
+class ImageDimensionViewHelper extends AbstractViewHelper
 {
     /**
      * Get width / height from image file
diff --git a/typo3/sysext/install/Classes/ViewHelpers/File/RelativePathViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/File/RelativePathViewHelper.php
index 183128c839db..b1c220198078 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/File/RelativePathViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/File/RelativePathViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\File;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get file path relative to PATH_site from absolute path
@@ -32,7 +31,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class RelativePathViewHelper extends AbstractViewHelper implements CompilableInterface
+class RelativePathViewHelper extends AbstractViewHelper
 {
     /**
      * Get relative path
diff --git a/typo3/sysext/install/Classes/ViewHelpers/File/SizeViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/File/SizeViewHelper.php
index ba61b7c09728..1e442c1d259e 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/File/SizeViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/File/SizeViewHelper.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\File;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Get file size from file
@@ -33,7 +32,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class SizeViewHelper extends AbstractViewHelper implements CompilableInterface
+class SizeViewHelper extends AbstractViewHelper
 {
     /**
      * Get size from file
diff --git a/typo3/sysext/install/Classes/ViewHelpers/Format/CropViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/Format/CropViewHelper.php
index 8333e3b65ccb..9ab3e86c05d2 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/Format/CropViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/Format/CropViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Simplified crop view helper that does not need a frontend environment
@@ -40,7 +39,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
  *
  * @internal
  */
-class CropViewHelper extends AbstractViewHelper implements CompilableInterface
+class CropViewHelper extends AbstractViewHelper
 {
     /**
      * Render the cropped text
diff --git a/typo3/sysext/install/Classes/ViewHelpers/Format/ImageMagickCommandsViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/Format/ImageMagickCommandsViewHelper.php
index 66a2c382b88e..e9e4a4b6f17d 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/Format/ImageMagickCommandsViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/Format/ImageMagickCommandsViewHelper.php
@@ -16,14 +16,13 @@ namespace TYPO3\CMS\Install\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Display image magick commands
  *
  * @internal
  */
-class ImageMagickCommandsViewHelper extends AbstractViewHelper implements CompilableInterface
+class ImageMagickCommandsViewHelper extends AbstractViewHelper
 {
     /**
      * Display image magick commands
diff --git a/typo3/sysext/install/Classes/ViewHelpers/Format/PhpErrorCodeViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/Format/PhpErrorCodeViewHelper.php
index 0208c4821a39..cf0674592fd8 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/Format/PhpErrorCodeViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/Format/PhpErrorCodeViewHelper.php
@@ -16,14 +16,13 @@ namespace TYPO3\CMS\Install\ViewHelpers\Format;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Transform PHP error code to readable text
  *
  * @internal
  */
-class PhpErrorCodeViewHelper extends AbstractViewHelper implements CompilableInterface
+class PhpErrorCodeViewHelper extends AbstractViewHelper
 {
     /**
      * @var array
diff --git a/typo3/sysext/install/Classes/ViewHelpers/Object/ArrayValueByKeyViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/Object/ArrayValueByKeyViewHelper.php
index 25de4b7d161d..cd10d6cbc372 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/Object/ArrayValueByKeyViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/Object/ArrayValueByKeyViewHelper.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\ViewHelpers\Object;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Install\ViewHelpers\Exception;
 
 /**
@@ -33,7 +32,7 @@ use TYPO3\CMS\Install\ViewHelpers\Exception;
  *
  * @internal
  */
-class ArrayValueByKeyViewHelper extends AbstractViewHelper implements CompilableInterface
+class ArrayValueByKeyViewHelper extends AbstractViewHelper
 {
     /**
      * Get the value of an key in an array.
diff --git a/typo3/sysext/install/Classes/ViewHelpers/PhpInfoViewHelper.php b/typo3/sysext/install/Classes/ViewHelpers/PhpInfoViewHelper.php
index b5ba5cef2634..c69d2f282c22 100644
--- a/typo3/sysext/install/Classes/ViewHelpers/PhpInfoViewHelper.php
+++ b/typo3/sysext/install/Classes/ViewHelpers/PhpInfoViewHelper.php
@@ -16,21 +16,22 @@ namespace TYPO3\CMS\Install\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Utility class for phpinfo()
  * @internal
  */
-class PhpInfoViewHelper extends AbstractViewHelper implements CompilableInterface
+class PhpInfoViewHelper extends AbstractViewHelper
 {
     /**
-     * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper
-     * can decode the text's entities.
-     *
      * @var bool
      */
-    protected $escapingInterceptorEnabled = false;
+    protected $escapeOutput = false;
+
+    /**
+     * @var bool
+     */
+    protected $escapeChildren = false;
 
     /**
      * Render PHP info
diff --git a/typo3/sysext/install/Resources/Private/Layouts/Step.html b/typo3/sysext/install/Resources/Private/Layouts/Step.html
index 44759a4bac83..18c6fe322012 100644
--- a/typo3/sysext/install/Resources/Private/Layouts/Step.html
+++ b/typo3/sysext/install/Resources/Private/Layouts/Step.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:i="http://typo3.org/ns/TYPO3/CMS/Install/ViewHelpers">
+<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
 	<head>
 		<title>Installing TYPO3 CMS</title>
 		<f:render partial="Action/Common/Headers" arguments="{_all}" />
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Common/StatusMessage.html b/typo3/sysext/install/Resources/Private/Partials/Action/Common/StatusMessage.html
index 488875e6a5b0..8adeb75a6fb5 100644
--- a/typo3/sysext/install/Resources/Private/Partials/Action/Common/StatusMessage.html
+++ b/typo3/sysext/install/Resources/Private/Partials/Action/Common/StatusMessage.html
@@ -14,9 +14,12 @@
 	<f:case value="loading">
 		<div class="t3js-message typo3-message alert alert-loading" role="alert">
 	</f:case>
-	<f:case default="TRUE">
+	<f:case value="">
 		<div class="t3js-message typo3-message alert alert-notice" role="alert">
 	</f:case>
+	<f:defaultCase>
+		<div class="t3js-message typo3-message alert alert-notice" role="alert">
+	</f:defaultCase>
 </f:switch>
 	<h4>{message.title}</h4>
 	<f:if condition="{message.message}">
diff --git a/typo3/sysext/install/Tests/Unit/ViewHelpers/Format/PhpErrorCodeViewHelperTest.php b/typo3/sysext/install/Tests/Unit/ViewHelpers/Format/PhpErrorCodeViewHelperTest.php
index e33cc81a48c9..f80ef5728b38 100644
--- a/typo3/sysext/install/Tests/Unit/ViewHelpers/Format/PhpErrorCodeViewHelperTest.php
+++ b/typo3/sysext/install/Tests/Unit/ViewHelpers/Format/PhpErrorCodeViewHelperTest.php
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Install\Tests\Unit\ViewHelpers\Format;
  */
 
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
 
 /**
  * Test case
@@ -33,7 +34,7 @@ class PhpErrorCodeViewHelperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         $this->viewHelper = $this->getMock(\TYPO3\CMS\Install\ViewHelpers\Format\PhpErrorCodeViewHelper::class, array('dummy'));
         /** @var RenderingContext $renderingContext */
-        $renderingContext = $this->getMock(RenderingContext::class);
+        $renderingContext = new RenderingContextFixture();
         $this->viewHelper->setRenderingContext($renderingContext);
     }
 
diff --git a/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php b/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php
index 30b40af24fcb..6ffe289f07ca 100644
--- a/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php
+++ b/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Reports\ViewHelpers;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
 
 /**
@@ -25,7 +24,7 @@ use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
  *
  * @internal
  */
-class IconViewHelper extends AbstractBackendViewHelper implements CompilableInterface
+class IconViewHelper extends AbstractBackendViewHelper
 {
     /**
      * Renders the icon
diff --git a/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html b/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
index d995a62f9b57..4a373f43fb73 100644
--- a/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
+++ b/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
@@ -10,7 +10,7 @@
 			{error}
 		</f:then>
 		<f:else>
-			<f:format.html parseFuncTSPath="">{content}</f:format.html>
+			<f:format.html parseFuncTSPath="">{content -> f:format.raw()}</f:format.html>
 		</f:else>
 	</f:if>
-</f:section>
\ No newline at end of file
+</f:section>
diff --git a/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php b/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
index 90637ee55a6a..4976dca0740d 100644
--- a/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
+++ b/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
@@ -17,13 +17,12 @@ namespace TYPO3\CMS\Scheduler\ViewHelpers;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * Create internal link within backend app
  * @internal
  */
-class ModuleLinkViewHelper extends AbstractViewHelper implements CompilableInterface
+class ModuleLinkViewHelper extends AbstractViewHelper
 {
     /**
      * Render module link with command and arguments
diff --git a/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php b/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
index 43baefdff818..dd4b7d3c8a5d 100644
--- a/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
+++ b/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
@@ -18,14 +18,13 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * ViewHelper to create a link to delete a note
  *
  * @internal
  */
-class DeleteLinkViewHelper extends AbstractViewHelper implements CompilableInterface
+class DeleteLinkViewHelper extends AbstractViewHelper
 {
     /**
      * Create link to delete a note
diff --git a/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php b/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
index 764f605a8ef5..0b7bd0e73546 100644
--- a/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
+++ b/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
@@ -18,13 +18,12 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 
 /**
  * ViewHelper to create a link to edit a note
  * @internal
  */
-class EditLinkViewHelper extends AbstractViewHelper implements CompilableInterface
+class EditLinkViewHelper extends AbstractViewHelper
 {
     /**
      * @param int $id
-- 
GitLab