[BUGFIX] Avoid incomplete mock in FluidTemplateContentObjectTest
FluidTemplateContentObject calls: $headerAssets = $this->view->renderSection(...); if (!empty(trim($headerAssets))) { ... This expects that renderSection() actually returns a string, which it usually does. Not returning a string and then calling trim(null) emits a PHP 8.1 E_DEPRECATED error. The heavy mocking FluidTemplateContentObjectTest class however misses to mock the view properly in many places and then triggers the trim(null) deprecation since especially renderSection() method mock is not instructed to return string and falls back to null. The patch takes care of proper mocking and adds a todo these tests would benefit from being turned into functional tests to avoid the mock party. Change-Id: Ifc2cb6ca00f09af0c6bd850f31c8807347e8c645 Resolves: #95771 Releases: master Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71969 Tested-by:core-ci <typo3@b13.com> Tested-by:
Jochen <rothjochen@gmail.com> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Jochen <rothjochen@gmail.com> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de>
This diff is collapsed.
Please register or sign in to comment