Review main Merged

69857[TASK] Refactor ViewHelper tests

Christian Kuhn CR +2 V +2 Impossible +4674 −8630 updated 07/19/21, 15:28

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 120

Show 100 more files