Skip to content
  • Christian Kuhn's avatar
    [TASK] Refactor ViewHelper tests · ad3a216d
    Christian Kuhn authored
    We have a decent test coverage of view helpers, especially
    those within ext:fluid. This is an important asset and we're
    sure all main functionality works.
    
    Most of the tests rely on ViewHelperBaseTestcase from the
    testing framework. This class prepares the main mocking
    of view helper dependencies. Reading the code it becomes
    obvious that this approach is kinda unfortunate: View
    helpers are part of a bigger system - they have some
    general dependencies like the rendering context, the
    request and render children. This leads to a mocking
    party in many unit tests, making the test goal hard to
    understand and follow.
    The mock preparations and assumptions of internal handling
    actively block further separation of concern patches
    within ext:fluid since the ViewHelperBaseTestcase breaks
    all the time.
    
    The patch refactors all unit tests that extend
    ViewHelperBaseTestcase towards functional tests:
    Most of them simply create a StandaloneView, feed a
    template string for the specific view helper and
    string compare the render result. Some FE related VH
    tests additionally set up a full frontend and retrieve
    a rendered fluid view as sub request.
    
    This makes the tests much easier to read, follow and
    understand. The functional tests are now good examples
    to show the various features of single VH's.
    
    Change-Id: I6c5d4eeb0c79ba66a18398a5623a591381a6d707
    Resolves: #94580
    Releases: master
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69857
    
    
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarJochen <rothjochen@gmail.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: default avatarJochen <rothjochen@gmail.com>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    ad3a216d