Review main Merged

71969[BUGFIX] Avoid incomplete mock in FluidTemplateContentObjectTest

Christian Kuhn CR +2 V +2 Normal +133 −45 updated 10/25/21, 18:00

Commit message

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.

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 1